diff options
author | Zoltan Varga <vargaz@gmail.com> | 2010-10-18 03:55:41 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2010-10-18 03:55:41 +0400 |
commit | 257a08850a7e49251cbddefc292dcef84f27d77d (patch) | |
tree | 50baf861638768057311bbf59656868453d1077b /libgc/pthread_support.c | |
parent | aa53562093604edd2400932500a915f996cadd04 (diff) |
Avoid calling sem_post on a uninitialized semaphore during thread attach, it works under linux, but fails under *bsd. Fixes #647248.
Diffstat (limited to 'libgc/pthread_support.c')
-rw-r--r-- | libgc/pthread_support.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index f70d4f6e731..2d54a513d01 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -1344,7 +1344,8 @@ void * GC_start_routine_head(void * arg, void *base_addr, if (start) *start = si -> start_routine; if (start_arg) *start_arg = si -> arg; - sem_post(&(si -> registered)); /* Last action on si. */ + if (!(si->flags & FOREIGN_THREAD)) + sem_post(&(si -> registered)); /* Last action on si. */ /* OK to deallocate. */ # if defined(THREAD_LOCAL_ALLOC) && !defined(DBG_HDRS_ALL) LOCK(); |