summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2009-11-06 06:54:29 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:51 +0200
commitdabce82fc68eadae5f5de87dacf52eb0509c3361 (patch)
treeaf679f5f5b7435cef5deb72fb18c04b0617e918f /misc.c
parent9ba19e6566ab47ac877a02f51b4443edb9a9b924 (diff)
2009-11-06 Ivan Maidanski <ivmai@mail.ru>
* include/private/gc_priv.h (GC_write_disabled): New variable declaration (only if GC_ASSERTIONS and Win32 threads). * misc.c (GC_write): Add assertion for GC_write_disabled value is not on (only if THREADS). * win32_threads.c (GC_write_disabled): New variable (only if GC_ASSERTIONS and not Cygwin). * win32_threads.c (GC_stop_world): Set and clear GC_write_disabled (while holding GC_write_cs).
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index f7a10a6..4254096 100644
--- a/misc.c
+++ b/misc.c
@@ -978,6 +978,9 @@ out:
if (len == 0)
return 0;
IF_NEED_TO_LOCK(EnterCriticalSection(&GC_write_cs));
+# ifdef THREADS
+ GC_ASSERT(!GC_write_disabled);
+# endif
if (GC_stdout == INVALID_HANDLE_VALUE) {
IF_NEED_TO_LOCK(LeaveCriticalSection(&GC_write_cs));
return -1;