]> granicus.if.org Git - gc/commit
Fix user-defined signals drop by marker threads
authorHiroshi Yokota <yokota@netlab.cs.tsukuba.ac.jp>
Sat, 6 Feb 2016 01:25:48 +0000 (10:25 +0900)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 3 Mar 2016 20:43:10 +0000 (23:43 +0300)
commit95947bdc584abab6def8c00d9edf6488c4dfcb1c
treef5fd06f3ae01c1012ae3db5660cf0addd9d869a4
parentac0a5441c50540201f29fc7da096fb9580f1ecc8
Fix user-defined signals drop by marker threads

When one user thread sets its own signal handler in multi-threaded
code, GC marker thread sometimes steal and drop user signal calls.
Because GC marker thread doesn't knows the user thread's signal
handler, and uses the default signal handler that ignores any signal
call.  This becomes to drop the signal call.

This patch inhibits to accept signals by GC marker threads except
GC system signals, and don't drop user signal calls.

This patch comes from Gauche.

* include/private/gcconfig.h (NO_MARKER_SPECIAL_SIGMASK): New macro.
* pthread_support.c (GC_start_mark_threads_inner): Unless
NO_MARKER_SPECIAL_SIGMASK, call pthread_sigmask to block all signals
(except for the ones used for GC suspend/resume if any) before
starting marker threads and restore signals mask afterwards.
* win32_threads.c (GC_start_mark_threads_inner): Likewise.
include/private/gcconfig.h
pthread_support.c
win32_threads.c