diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2013-07-16 16:19:12 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2013-07-16 16:19:12 +0400 |
commit | a05920c6a86a0e2b9c7989c5b42945d89039e8a7 (patch) | |
tree | f39a1856c6d094e7edc43b83ebc8076e68c082a8 /pthread_start.c | |
parent | 07676ad23c787fc5d399830308ae2a749151c627 (diff) | |
download | bdwgc-a05920c6a86a0e2b9c7989c5b42945d89039e8a7.tar.gz |
Allow to compile GC_inner_start_routine aside from extra/gc.c
(for proper exceptions support on Linux)
* extra/gc.c: Do not include pthread_start.c if
GC_PTHREAD_START_STANDALONE defined (thus pthread_start.c could go to
a standalone compilation unit).
* include/private/pthread_support.h (GC_INNER_PTHRSTART): New macro
(defined to either empty or GC_INNER depending on
GC_PTHREAD_START_STANDALONE).
* include/private/pthread_support.h (GC_start_rtn_prepare_thread,
GC_thread_exit_proc): Replace GC_INNER to GC_INNER_PTHRSTART.
* pthread_support.c (GC_thread_exit_proc,
GC_start_rtn_prepare_thread): Likewise.
* pthread_start.c (GC_inner_start_routine): Define as
GC_INNER_PTHRSTART; do not call GC_log_printf if
GC_PTHREAD_START_STANDALONE (since the function might be visible only
within extra/gc.c compilation unit).
* pthread_support.c (GC_inner_start_routine): Declare as
GC_INNER_PTHRSTART.
Diffstat (limited to 'pthread_start.c')
-rw-r--r-- | pthread_start.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pthread_start.c b/pthread_start.c index 776a368d..bd4fc4a0 100644 --- a/pthread_start.c +++ b/pthread_start.c @@ -42,7 +42,8 @@ #include <sched.h> /* Invoked from GC_start_routine(). */ -void * GC_CALLBACK GC_inner_start_routine(struct GC_stack_base *sb, void *arg) +GC_INNER_PTHRSTART void * GC_CALLBACK GC_inner_start_routine( + struct GC_stack_base *sb, void *arg) { void * (*start)(void *); void * start_arg; @@ -54,7 +55,7 @@ void * GC_CALLBACK GC_inner_start_routine(struct GC_stack_base *sb, void *arg) pthread_cleanup_push(GC_thread_exit_proc, me); # endif result = (*start)(start_arg); -# ifdef DEBUG_THREADS +# if defined(DEBUG_THREADS) && !defined(GC_PTHREAD_START_STANDALONE) GC_log_printf("Finishing thread %p\n", (void *)pthread_self()); # endif me -> status = result; |