summaryrefslogtreecommitdiff
path: root/pthread_stop_world.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2009-05-28 02:51:35 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:45 +0200
commitebabfaa4168439668bb8b3b033276f8998cacb4b (patch)
treeca7bde930cc0c8bb24c623fe58c9c6a4a87854db /pthread_stop_world.c
parent5190c1d75ea1f284124e52628625a83bcee5fc3c (diff)
2009-05-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidanski)
(diff26) * win32_threads.c: restructure parallel marking mutex intialization. * win32_threads.c, alloc.c, darwin_stop_world.c, mallocx.c, mark.c, pthread_stop_world.c, pthread_support.c: Add runtime conditions on GC_parallel were appropriate. * pthread_support.c: Condition marker_bsp on ia64. (GC_segment_is_thread_stack): Fix loop upper bound. * reclaim.c: Limit some assertions to PARALLEL_MARK. * pthread_support.c: Don't acquire mark lock for thread-local allocation. * include/private/gc_priv.h: Don't define parallel mark sync support just for THREAD_LOCAL_ALLOC.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r--pthread_stop_world.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pthread_stop_world.c b/pthread_stop_world.c
index 9f2067f..737bbfd 100644
--- a/pthread_stop_world.c
+++ b/pthread_stop_world.c
@@ -383,9 +383,11 @@ void GC_stop_world(void)
/* required to acquire and release the GC lock before it starts, */
/* and we have the lock. */
# ifdef PARALLEL_MARK
- GC_acquire_mark_lock();
- GC_ASSERT(GC_fl_builder_count == 0);
- /* We should have previously waited for it to become zero. */
+ if (GC_parallel) {
+ GC_acquire_mark_lock();
+ GC_ASSERT(GC_fl_builder_count == 0);
+ /* We should have previously waited for it to become zero. */
+ }
# endif /* PARALLEL_MARK */
AO_store(&GC_stop_count, GC_stop_count+1);
/* Only concurrent reads are possible. */
@@ -432,7 +434,8 @@ void GC_stop_world(void)
}
}
# ifdef PARALLEL_MARK
- GC_release_mark_lock();
+ if (GC_parallel)
+ GC_release_mark_lock();
# endif
# if DEBUG_THREADS
GC_printf("World stopped from 0x%x\n", (unsigned)pthread_self());