summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorJie Liu <lj8175@gmail.com>2011-09-09 16:21:49 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-09-09 16:21:49 +0200
commit0539e08bb47d310c01bbb35354954436157110d0 (patch)
tree70556fd88bd88c725b9f935d2a4015a510e5f365 /pthread_stop_world.c
parentd40bcf238067f2be8e9a8327b2e915eeab8d6818 (diff)
Support multi-threading for RTEMS target.
(Apply commit e773036) * configure.ac: Add GC_RTEMS_PTHREADS AH_TEMPLATE and configure for rtems. * os_dep.c: Add GC_get_stack_base if GC_RTEMS_PTHREADS for rtems. * pthread_stop_world.c (GC_stop_init): Add ifdef SA_RESTART. * pthread_stop_world.c (GC_stop_init): Use sigprocmask for rtems when defined GC_RTEMS_PTHREADS. * pthread_support.c: Exclude sys/mman.h for rtems. * pthread_support.c (GC_thr_init): Set default GC_nprocs (1) for rtems. * include/gc_config_macros.h: Define GC_RTEMS_PTHREADS for rtems pthread and define GC_NO_DLOPEN for rtems. * include/private/gc_locks.h: Define USE_PTHREAD_LOCKS for rtems. * include/private/gcconfig.h: Use rtems_get_stack_bottom() for InitStackBottom; and use SIGUSR1 for SIG_SUSPEND, SIGUSR2 for SIG_THR_RESTART on rtems. * include/private/thread_local_alloc.h: Use USE_PTHREAD_SPECIFIC for rtems. * tests/test.c (Init): Use exit(0) for rtems instead of return. * configure: Regenerate. * include/private/config.h.in: Ditto.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 9302f93..fa4e4d5 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -816,14 +816,23 @@ GC_INNER void GC_stop_init(void)
ABORT("sem_init failed");
# endif
- act.sa_flags = SA_RESTART
+# ifdef SA_RESTART
+ act.sa_flags = SA_RESTART
+# else
+ act.sa_flags = 0
+# endif
# ifdef SA_SIGINFO
- | SA_SIGINFO
+ | SA_SIGINFO
# endif
;
if (sigfillset(&act.sa_mask) != 0) {
ABORT("sigfillset() failed");
}
+# ifdef GC_RTEMS_PTHREADS
+ if(sigprocmask(SIG_UNBLOCK, &act.sa_mask, NULL) != 0) {
+ ABORT("rtems sigprocmask() failed");
+ }
+# endif
GC_remove_allowed_signals(&act.sa_mask);
/* SIG_THR_RESTART is set in the resulting mask. */
/* It is unmasked by the handler when necessary. */