summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-03-04 00:11:41 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-03-04 00:11:41 +0300
commit6a283de1db84c15e048cf9df6b47f4368b2e226a (patch)
tree28942acabd9eeebb00eae2cdd27b43bd16da508d /win32_threads.c
parentce77122ae1cb549833970189889f79d7fc8b8b6d (diff)
downloadbdwgc-6a283de1db84c15e048cf9df6b47f4368b2e226a.tar.gz
Define GC_self_thread_inner to lookup GC_thread of current thread
(refactoring) * include/private/pthread_support.h (GC_self_thread_inner): New macro. * pthread_stop_world.c (GC_lookup_thread_async): Replace to no-arg GC_lookup_self_thread_async(); update comment. * pthread_stop_world.c (GC_suspend_handler_inner): Remove self local variable, use pthread_self() instead. * pthread_stop_world.c [NACL] (__nacl_suspend_thread_if_needed): Likewise. * pthread_stop_world.c (GC_suspend_handler_inner): Call GC_lookup_self_thread_async() instead of GC_lookup_thread_async(self). * pthread_stop_world.c [NACL] (GC_nacl_shutdown_gc_thread): Do not use GC_lookup_thread(pthread_self()) in assertion. * win32_threads.c (GC_thr_init): Likewise. * pthread_support.c (GC_self_thread): New STATIC function. * pthread_support.c [!GC_NO_FINALIZATION] (GC_reset_finalizer_nested): Remove me local variable. * pthread_support.c [!GC_NO_FINALIZATION] (GC_reset_finalizer_nested, GC_check_finalizer_nested): Call GC_self_thread_inner() instead of GC_lookup_thread(thread_id_self()). * pthread_support.c [!GC_WIN32_THREADS] (GC_register_altstack, GC_thr_init): Likewise. * pthread_support.c [THREAD_LOCAL_ALLOC] (GC_init_parallel): Likewise. * pthread_support.c (GC_do_blocking_inner, GC_set_stackbottom, GC_get_stackbottom, GC_call_with_gc_active, GC_unregister_my_thread, GC_register_my_thread): Likewise. * pthread_support.c [GC_HAVE_PTHREAD_EXIT] (GC_pthread_exit): Likewise. * pthread_support.c [GC_ASSERTIONS && THREAD_LOCAL_ALLOC] (GC_is_thread_tsd_valid): Use GC_self_thread() instead of locking and GC_lookup_thread(thread_id_self()). * pthread_support.c (GC_thread_is_registered): Likewise. * pthread_support.c [GC_ASSERTIONS] (GC_allow_register_threads): Likewise. * pthread_support.c (GC_thread_is_registered, GC_get_stackbottom, GC_call_with_gc_active, GC_unregister_my_thread, GC_register_my_thread): Remove self_id local variable. * pthread_support.c [!GC_WIN32_THREADS] (GC_register_altstack, GC_thr_init): Likewise. * pthread_support.c [GC_HAVE_PTHREAD_EXIT] (GC_pthread_exit): Likewise.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 1be559e5..91a2a037 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -1741,7 +1741,6 @@ GC_INNER void GC_thr_init(void)
}
# endif /* PARALLEL_MARK */
- GC_ASSERT(NULL == GC_lookup_thread(self_id));
GC_register_my_thread_inner(&sb, self_id);
}