diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-03-27 14:56:12 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-03-27 14:56:12 +0300 |
commit | 1ae3d0fbb248509fad6e576c8eb90b81e382ed40 (patch) | |
tree | 32c3781d9d3925b3ae0816c6accdae51d58ebe1c /pthread_stop_world.c | |
parent | 5a580a5fa02c879e8235cfc869815f4738d92be0 (diff) | |
download | bdwgc-1ae3d0fbb248509fad6e576c8eb90b81e382ed40.tar.gz |
Fix GC_suspend_thread if called before thread destructor
(fix of commit f530696ac)
* include/private/pthread_stop_world.h [GC_ENABLE_SUSPEND_THREAD
&& !GC_OPENBSD_UTHREADS && !NACL && !PLATFORM_STOP_WORLD
&& !SN_TARGET_PSP2] (suspend_self_inner): Declare function as GC_INNER.
* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (suspend_self_inner):
Remove declaration; change definition from static to GC_INNER.
* pthread_support.c [GC_ENABLE_SUSPEND_THREAD && !GC_DARWIN_THREADS
&& !GC_OPENBSD_UTHREADS && !NACL && !PLATFORM_STOP_WORLD
&& !SN_TARGET_PSP2] (GC_register_my_thread): If me->suspended_ext then
unlock and call GC_do_blocking(suspend_self_inner); add comment.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r-- | pthread_stop_world.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c index b64b8210..e5419347 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -78,10 +78,6 @@ /* It's safe to call original pthread_sigmask() here. */ #undef pthread_sigmask -#ifdef GC_ENABLE_SUSPEND_THREAD - static void *GC_CALLBACK suspend_self_inner(void *client_data); -#endif - #ifdef DEBUG_THREADS # ifndef NSIG # if defined(MAXSIG) @@ -637,7 +633,7 @@ STATIC void GC_restart_handler(int sig) (void)select(0, 0, 0, 0, &tv); } - static void *GC_CALLBACK suspend_self_inner(void *client_data) { + GC_INNER void *GC_CALLBACK suspend_self_inner(void *client_data) { GC_thread me = (GC_thread)client_data; while (ao_load_acquire_async(&me->suspended_ext)) { |