Skip to content

Commit

Permalink
Unblock only GC signals in suspend_handler (TSan)
Browse files Browse the repository at this point in the history
Issue #181 (bdwgc).

* pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL
&& THREAD_SANITIZER] (GC_suspend_handler_inner): Replace
pthread_sigmask(SIG_SETMASK) to pthread_sigmask(SIG_UNBLOCK) with the
set with GC_sig_suspend and GC_sig_thr_restart signals.
  • Loading branch information
ivmai committed Mar 30, 2018
1 parent 5e6cc59 commit 5bf02fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pthread_stop_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,12 @@ STATIC void GC_suspend_handler_inner(ptr_t dummy GC_ATTR_UNUSED,
{
sigset_t set;
sigemptyset(&set);
if (pthread_sigmask(SIG_SETMASK, &set, NULL) != 0)
ABORT("pthread_sigmask(SIG_SETMASK) failed");
GC_ASSERT(GC_sig_suspend != SIGNAL_UNSET);
GC_ASSERT(GC_sig_thr_restart != SIGNAL_UNSET);
sigaddset(&set, GC_sig_suspend);
sigaddset(&set, GC_sig_thr_restart);
if (pthread_sigmask(SIG_UNBLOCK, &set, NULL) != 0)
ABORT("pthread_sigmask failed in suspend handler");
}
# endif
/* Tell the thread that wants to stop the world that this */
Expand Down

0 comments on commit 5bf02fe

Please sign in to comment.