summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-08-22 01:09:59 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-08-22 01:09:59 +0300
commit207ba534acd38fd1acd722e02a07cc33e09720c8 (patch)
treef6d59b4d383b7be2aa4ba5d368a97104dbd794f4 /pthread_support.c
parentf5e3318adf3c8e31fb1dd314a323281c5fa3c3f2 (diff)
downloadbdwgc-207ba534acd38fd1acd722e02a07cc33e09720c8.tar.gz
Eliminate unsigned fl_builder_count underflow in mark_thread
(refactor commit 0ca6d3f) * include/private/gc_priv.h [PARALLEL_MARK] (GC_fl_builder_count): Change type from word to signed_word. * reclaim.c [PARALLEL_MARK] (GC_fl_builder_count): Likewise. * mark.c [PARALLEL_MARK] (GC_wait_for_markers_init): Change type of count local variable to signed_word; add assertion that count is non-negative. * pthread_support.c [PARALLEL_MARK] (GC_mark_thread): Add comment that GC_fl_builder_count can be negative here. * win32_threads.c [PARALLEL_MARK] (GC_mark_thread): Likewise. * reclaim.c [PARALLEL_MARK] (GC_fl_builder_count): Refine comment.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pthread_support.c b/pthread_support.c
index cb31824a..92565fbe 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -357,7 +357,7 @@ STATIC void * GC_mark_thread(void * id)
/* Inform GC_start_mark_threads about completion of marker data init. */
GC_acquire_mark_lock();
- if (0 == --GC_fl_builder_count)
+ if (0 == --GC_fl_builder_count) /* count may have a negative value */
GC_notify_all_builder();
GC_release_mark_lock();