summaryrefslogtreecommitdiff
path: root/pthread_stop_world.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_stop_world.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_stop_world.c')
-rw-r--r--pthread_stop_world.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index af0c62e..d7680e4 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -129,7 +129,8 @@ STATIC volatile AO_t GC_world_is_stopped = FALSE;
*/
#ifndef SIG_THR_RESTART
-# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || defined(GC_NETBSD_THREADS)
+# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) \
+ || defined(GC_NETBSD_THREADS)
# ifdef _SIGRTMIN
# define SIG_THR_RESTART _SIGRTMIN + 5
# else
@@ -794,10 +795,10 @@ GC_INNER void GC_stop_init(void)
# if !defined(GC_OPENBSD_THREADS) && !defined(NACL)
struct sigaction act;
- if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
+ if (sem_init(&GC_suspend_ack_sem, GC_SEM_INIT_PSHARED, 0) != 0)
ABORT("sem_init failed");
# ifdef GC_NETBSD_THREADS_WORKAROUND
- if (sem_init(&GC_restart_ack_sem, 0, 0) != 0)
+ if (sem_init(&GC_restart_ack_sem, GC_SEM_INIT_PSHARED, 0) != 0)
ABORT("sem_init failed");
# endif