summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-04-26 23:09:41 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:58 +0200
commit55c48e217fac1f752c19c36895f634beb2ba0dae (patch)
tree4135804752f4633935e37effe4ddd6e7a953325b /pthread_support.c
parent782c5a03ff94e2e2c4ec90ab40e6302a083e8abf (diff)
2011-04-26 Ivan Maidanski <ivmai@mail.ru>
* .cvsignore (initsecondarythread, test_cpp): Add. * os_dep.c (GC_linux_stack_base): Rename to GC_linux_main_stack_base. * os_dep.c (GC_freebsd_stack_base): Rename to GC_freebsd_main_stack_base; adjust error message. * pthread_stop_world.c (GC_stop_init): Use GC_SEM_INIT_PSHARED as an argument for sem_init(). * pthread_support.c (pthread_create): Ditto. * pthread_support.c (pthread_create): Abort in case sem_init() fails. * include/private/gc_priv.h (GC_SEM_INIT_PSHARED): Define. * tests/initsecondarythread.c: Include gcconfig.h; call GC_INIT from main() if it should be done from the primordial thread only.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pthread_support.c b/pthread_support.c
index 2feeac3..575ac9d 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -1482,7 +1482,9 @@ GC_API int WRAP_FUNC(pthread_create)(pthread_t *new_thread,
(si = (struct start_info *)
(*GC_get_oom_fn())(sizeof(struct start_info))) == 0)
return(ENOMEM);
- sem_init(&(si -> registered), 0, 0);
+ if (sem_init(&(si -> registered), GC_SEM_INIT_PSHARED, 0) != 0)
+ ABORT("sem_init failed");
+
si -> start_routine = start_routine;
si -> arg = arg;
LOCK();