summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-12-31 18:50:45 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-12-31 18:50:45 +0300
commit2cd04cd95cef35180a021e83f7fb9ac268e6ab3b (patch)
treeea7fcf9f4f3635bf412c448aaac49800b75d65a3 /pthread_stop_world.c
parent40b23a42c73ed11d384a5ed81e8f5eb126edb434 (diff)
downloadbdwgc-2cd04cd95cef35180a021e83f7fb9ac268e6ab3b.tar.gz
Uniform use of GC_lookup_by_pthread in GC_pthread_join/detach
(refactoring) * include/private/pthread_support.h [GC_WIN32_THREADS && GC_PTHREADS] (GC_lookup_by_pthread): Move declaration down. * include/private/pthread_support.h [GC_PTHREADS && !GC_WIN32_THREADS] (GC_lookup_by_pthread): Define as macro (to GC_lookup_thread). * pthread_stop_world.c [!NACL && GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread, GC_resume_thread, GC_is_thread_suspended): Use GC_lookup_by_pthread() instead of GC_lookup_thread(). * pthread_support.c [!GC_NO_PTHREAD_CANCEL && GC_PTHREADS && CANCEL_SAFE] (GC_pthread_cancel): Likewise. * pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS && !SN_TARGET_PSP2] (GC_pthread_join, GC_pthread_detach): Likewise. * pthread_support.c [GC_PTHREADS && !SN_TARGET_ORBIS && !SN_TARGET_PSP2 && GC_WIN32_THREADS] (GC_pthread_join, GC_pthread_detach): Wrap GC_lookup_by_pthread() call into LOCK/UNLOCK. * win32_threads.c [GC_PTHREADS] (GC_lookup_by_pthread): Refine comment; define id local variable; remove hv_guess local variable; replace break with return p; remove LOCK() and UNLOCK(); add assertion that the GC lock is held.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index ff3c3411..d171dc68 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -641,7 +641,7 @@ STATIC void GC_restart_handler(int sig)
DCL_LOCK_STATE;
LOCK();
- t = GC_lookup_thread((pthread_t)thread);
+ t = GC_lookup_by_pthread((pthread_t)thread);
if (NULL == t) {
UNLOCK();
return;
@@ -721,7 +721,7 @@ STATIC void GC_restart_handler(int sig)
DCL_LOCK_STATE;
LOCK();
- t = GC_lookup_thread((pthread_t)thread);
+ t = GC_lookup_by_pthread((pthread_t)thread);
if (t != NULL) {
word suspend_cnt = (word)(t -> ext_suspend_cnt);
@@ -759,7 +759,7 @@ STATIC void GC_restart_handler(int sig)
DCL_LOCK_STATE;
LOCK();
- t = GC_lookup_thread((pthread_t)thread);
+ t = GC_lookup_by_pthread((pthread_t)thread);
if (t != NULL && (t -> ext_suspend_cnt & 1) != 0)
is_suspended = (int)TRUE;
UNLOCK();