summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-03-10 07:38:33 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-03-10 11:39:53 +0300
commit5a8c02852532169ad81a87b553dc5fb3142d9e61 (patch)
tree60e98a51cab583de1e44cf712ec86b5481809565 /include
parent1908d8242271880100f24bb685919b3e6a0c1b2f (diff)
downloadbdwgc-5a8c02852532169ad81a87b553dc5fb3142d9e61.tar.gz
Fix GC_thread_is_registered for finished threads
(fix of commit 83c1eecd0) A finished thread may still stay in GC_threads, but it is no longer considered during a garbage collection phase, thus GC_thread_is_registered() should return false in such a case. * include/gc/gc.h [GC_THREADS] (GC_thread_is_registered): Refine comment (describe the case when the thread is marked as finished). * pthread_support.c (GC_thread_is_registered): Define and set me local variable; return FALSE if KNOWN_FINISHED(me).
Diffstat (limited to 'include')
-rw-r--r--include/gc/gc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/gc/gc.h b/include/gc/gc.h
index bf64d2d9..c7640562 100644
--- a/include/gc/gc.h
+++ b/include/gc/gc.h
@@ -1626,6 +1626,8 @@ GC_API void GC_CALL GC_start_mark_threads(void);
/* Return 1 (true) if the calling (current) thread is registered with */
/* the garbage collector, 0 otherwise. Acquires the allocator lock. */
+ /* If the thread is finished (e.g. running in a destructor and not */
+ /* registered manually again), it is considered as not registered. */
GC_API int GC_CALL GC_thread_is_registered(void);
/* Notify the collector about the stack and the alt-stack of the */