diff options
author | ivmai <ivmai> | 2010-10-09 08:05:29 +0200 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-26 19:06:55 +0200 |
commit | e8b0c281fced017d9d7d2860e248e59eca130c75 (patch) | |
tree | 44b910ad193e36220c543ec1b6f6dcf53f84f1cf /win32_threads.c | |
parent | 0da4f6413cac0a788efb3ab7322c690c934b1c5a (diff) |
2010-10-09 Ivan Maidanski <ivmai@mail.ru>
* darwin_stop_world.c (GC_mach_thread): Move from
darwin_stop_world.h.
* include/private/darwin_stop_world.h (GC_mach_thread): Remove.
* win32_threads.c (GC_start_world): Define "thread_id" local
variable only if GC_ASSERTIONS; decide whether to resume a thread
based on its "suspended" field value; assert that suspended thread
stack_base is non-zero and the thread is not our one.
Diffstat (limited to 'win32_threads.c')
-rw-r--r-- | win32_threads.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/win32_threads.c b/win32_threads.c index 894e10f..05c7c56 100644 --- a/win32_threads.c +++ b/win32_threads.c @@ -1067,7 +1067,9 @@ GC_INNER void GC_stop_world(void) GC_INNER void GC_start_world(void) { - DWORD thread_id = GetCurrentThreadId(); +# ifdef GC_ASSERTIONS + DWORD thread_id = GetCurrentThreadId(); +# endif int i; GC_ASSERT(I_HOLD_LOCK()); @@ -1075,8 +1077,8 @@ GC_INNER void GC_start_world(void) LONG my_max = GC_get_max_thread_index(); for (i = 0; i <= my_max; i++) { GC_thread t = (GC_thread)(dll_thread_table + i); - if (t -> stack_base != 0 && t -> suspended - && t -> id != thread_id) { + if (t -> suspended) { + GC_ASSERT(t -> stack_base != 0 && t -> id != thread_id); if (ResumeThread(THREAD_HANDLE(t)) == (DWORD)-1) ABORT("ResumeThread failed"); t -> suspended = FALSE; @@ -1088,8 +1090,8 @@ GC_INNER void GC_start_world(void) for (i = 0; i < THREAD_TABLE_SZ; i++) { for (t = GC_threads[i]; t != 0; t = t -> tm.next) { - if (t -> stack_base != 0 && t -> suspended - && t -> id != thread_id) { + if (t -> suspended) { + GC_ASSERT(t -> stack_base != 0 && t -> id != thread_id); if (ResumeThread(THREAD_HANDLE(t)) == (DWORD)-1) ABORT("ResumeThread failed"); UNPROTECT_THREAD(t); |