diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-07-24 13:23:12 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-07-24 13:25:34 +0400 |
commit | 977e8a0187f9961e843a6662022f05396aa33374 (patch) | |
tree | 9501b732d6a95101c0bce33032720de66676e9ef /os_dep.c | |
parent | 092f7dff3f7a0fafcc02ecb4a67e673f90aa7354 (diff) | |
download | bdwgc-977e8a0187f9961e843a6662022f05396aa33374.tar.gz |
Postpone the suspend signal in GC_dirty_init only if used to stop world
* os_dep.c (GC_dirty_init): Do not call sigaddset(SIG_SUSPEND) if
no THREADS or if SIG_SUSPEND is unused for suspending threads.
Diffstat (limited to 'os_dep.c')
-rw-r--r-- | os_dep.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -3309,22 +3309,18 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks, GC_INNER void GC_dirty_init(void) { # if !defined(MSWIN32) && !defined(MSWINCE) - struct sigaction act, oldact; - act.sa_flags = SA_RESTART | SA_SIGINFO; + struct sigaction act, oldact; + act.sa_flags = SA_RESTART | SA_SIGINFO; act.sa_sigaction = GC_write_fault_handler; (void)sigemptyset(&act.sa_mask); -# ifdef SIG_SUSPEND +# if defined(THREADS) && !defined(GC_OPENBSD_THREADS) \ + && !defined(GC_WIN32_THREADS) && !defined(NACL) /* Arrange to postpone the signal while we are in a write fault */ /* handler. This effectively makes the handler atomic w.r.t. */ /* stopping the world for GC. */ -# if defined(THREADS) && !defined(GC_OPENBSD_THREADS) \ - && !defined(GC_WIN32_THREADS) && !defined(NACL) - (void)sigaddset(&act.sa_mask, GC_get_suspend_signal()); -# else - (void)sigaddset(&act.sa_mask, SIG_SUSPEND); -# endif + (void)sigaddset(&act.sa_mask, GC_get_suspend_signal()); # endif -# endif +# endif /* !MSWIN32 */ if (GC_print_stats == VERBOSE) GC_log_printf( "Initializing mprotect virtual dirty bit implementation\n"); |