diff --git a/AUTHORS b/AUTHORS index 36f8bb5f7..09816f605 100644 --- a/AUTHORS +++ b/AUTHORS @@ -139,6 +139,7 @@ Jacob Navia Jakub Jelinek James Clark James Dominy +Jan Wielemaker Jani Kajala Jean-Baptiste Nivois Jean-Claude Beaudoin diff --git a/ChangeLog b/ChangeLog index 71211ca17..f4d53e363 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ ========================= * Add GC_UNDERSCORE_STDCALL, UNICODE macro templates to configure (Win32). +* Add GC_get_thr_restart_signal API entry. * Add GC_move_disappearing_link() API entry. * Add TODO file. * Add configure option to compile all library .c files into single gc.o. diff --git a/include/gc.h b/include/gc.h index f67e4eaa6..a7fd44908 100644 --- a/include/gc.h +++ b/include/gc.h @@ -1082,6 +1082,10 @@ GC_API void * GC_CALL GC_call_with_stack_base(GC_stack_base_func /* fn */, /* to suspend threads on POSIX systems. Return -1 otherwise. */ GC_API int GC_CALL GC_get_suspend_signal(void); + /* Return the signal number (constant) used by the garbage collector */ + /* to restart (resume) threads on POSIX systems. Return -1 otherwise. */ + GC_API int GC_CALL GC_get_thr_restart_signal(void); + /* Explicitly enable GC_register_my_thread() invocation. */ /* Done implicitly if a GC thread-creation function is called (or */ /* implicit thread registration is activated). Otherwise, it must */ diff --git a/misc.c b/misc.c index e825705ee..ac7859226 100644 --- a/misc.c +++ b/misc.c @@ -467,6 +467,13 @@ GC_API void GC_CALL GC_get_heap_usage_safe(GC_word *pheap_size, return -1; # endif } + +# if defined(GC_DARWIN_THREADS) || defined(GC_WIN32_THREADS) + GC_API int GC_CALL GC_get_thr_restart_signal(void) + { + return -1; /* GC does not use signals to restart threads. */ + } +# endif #endif /* THREADS */ #ifdef GC_READ_ENV_FILE diff --git a/pthread_stop_world.c b/pthread_stop_world.c index a94517e73..a354a84db 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -872,4 +872,13 @@ GC_INNER void GC_stop_init(void) # endif /* !GC_OPENBSD_THREADS && !NACL */ } + GC_API int GC_CALL GC_get_thr_restart_signal(void) + { +# if !defined(GC_OPENBSD_THREADS) && !defined(NACL) + return SIG_THR_RESTART; +# else + return -1; +# endif + } + #endif