-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use reader mode of lock in API functions with thread-local stores only
Issue #473 (bdwgc). These are GC_register_altstack, GC_do_blocking, GC_call_with_gc_active, GC_set_stackbottom, GC_calloc_do_explicitly_typed functions. * include/gc/gc.h (GC_call_with_reader_lock, GC_set_stackbottom): Update comment. * include/gc/gc.h (GC_register_altstack, GC_do_blocking, GC_call_with_gc_active): Refine comment about the allocator lock. * include/private/gc_locks.h (READER_UNLOCK_RELEASE): Define macro (to READER_UNLOCK). * misc.c [HAS_REAL_READER_LOCK] (GC_call_with_reader_lock): Call READER_UNLOCK_RELEASE() if release argument is non-zero. * pthread_support.c (GC_register_altstack, GC_do_blocking_inner, GC_call_with_gc_active): Replace LOCK/UNLOCK() with READER_LOCK/READER_UNLOCK_RELEASE(). * typd_mlc.c (GC_calloc_do_explicitly_typed): Likewise. * pthread_support.c [!E2K] (do_blocking_enter): Replace I_HOLD_LOCK() to I_HOLD_READER_LOCK(). * pthread_support.c (do_blocking_leave, GC_set_stackbottom): Likewise. * pthread_support.c [GC_ENABLE_SUSPEND_THREAD && SIGNAL_BASED_STOP_WORLD] (GC_suspend_self_blocked): Add comment. * tests/gctest.c (run_one_test): Call GC_call_with_reader_lock (with release argument set to 1) for set_stackbottom instead of GC_call_with_alloc_lock.
- Loading branch information
Showing
6 changed files
with
65 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters