path: root/
diff options
authorhboehm <hboehm>2009-09-26 02:06:51 +0200
committerIvan Maidanski <>2011-07-26 19:06:48 +0200
commit39cc5f4743cdf84f473507d8cb9ada62e69c81fb (patch)
treeb5f5b888258f81dc3b5f309f66f731474c234b7d /
parent183c30bb035c5ef2662ffa1da3557d26390c8cdf (diff)
2009-09-25 Hans Boehm <>
* include/private/gcconfig.h (CANCEL_SAFE, IF_CANCEL): new macros. * include/private/gc_priv.h (DISABLE_CANCEL, RESTORE_CANCEL, ASSERT_CANCEL_DISABLED): New macros. * alloc.c (GC_maybe_gc): Assert cancellation disabled. (GC_collect_a_little_inner,GC_try_to_collect, GC_collect_or_expand): Disable cancellation. (GC_add_to_our_memory): Check for overflow. * misc.c (GC_cancel_disable_count): declare. (GC_init, GC_write): Disable cancellation. (GC_init): Remove redundant GC_is_initialized test. * os_dep.c (GC_repeat_read): Assert cancellation disabled. (GC_get_stack_base): Disable cancellation. * pthread_stop_world.c (GC_suspend_handler_inner): Disable cancellation. * pthread_support.c (GC_mark_thread): Permanently disable cancellation. (GC_wait_for_gc_completion, GC_wait_builder, GC_wait_marker): Assert cancellation disabled. (fork handling): Disable cancellation, fix comment. (GC_pthread_create): Disable cancellation. (GC_unregister_my_thread): Disable cancellation. * Document NO_CANCEL_SAFE.
Diffstat (limited to '')
1 files changed, 6 insertions, 0 deletions
diff --git a/ b/
index ba1ca66..e3c79af 100644
--- a/
+++ b/
@@ -374,6 +374,12 @@ HOSTCFLAGS=$(CFLAGS)
# collection while leaving generational collection enabled).
# -DGC_FULL_FREQ=<value> Set alternate default number of partial collections
# between full collections (matters only if incremental collection is on).
+# -DNO_CANCEL_SAFE (posix platforms with threads only) Don't bother trying
+# to make the collector safe for thread cancellation; cancellation is
+# not used. (Note that if cancellation is used anyway, threads may end
+# up getting cancelled in unexpected places.) Even without this option,
+# PTHREAD_CANCEL_ASYNCHRONOUS is never safe with the collector. (We could
+# argue about its safety without the collector.)