233 |
# endif |
# endif |
234 |
} |
} |
235 |
|
|
236 |
|
/* Defined in misc.c */ |
237 |
|
extern CRITICAL_SECTION GC_write_cs; |
238 |
|
|
239 |
void GC_stop_world() |
void GC_stop_world() |
240 |
{ |
{ |
241 |
DWORD thread_id = GetCurrentThreadId(); |
DWORD thread_id = GetCurrentThreadId(); |
244 |
if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()"); |
if (!GC_thr_initialized) ABORT("GC_stop_world() called before GC_thr_init()"); |
245 |
|
|
246 |
GC_please_stop = TRUE; |
GC_please_stop = TRUE; |
247 |
|
# ifndef CYGWIN32 |
248 |
|
EnterCriticalSection(&GC_write_cs); |
249 |
|
# endif /* !CYGWIN32 */ |
250 |
for (i = 0; i <= GC_get_max_thread_index(); i++) |
for (i = 0; i <= GC_get_max_thread_index(); i++) |
251 |
if (thread_table[i].stack_base != 0 |
if (thread_table[i].stack_base != 0 |
252 |
&& thread_table[i].id != thread_id) { |
&& thread_table[i].id != thread_id) { |
277 |
# endif |
# endif |
278 |
thread_table[i].suspended = TRUE; |
thread_table[i].suspended = TRUE; |
279 |
} |
} |
280 |
|
# ifndef CYGWIN32 |
281 |
|
LeaveCriticalSection(&GC_write_cs); |
282 |
|
# endif /* !CYGWIN32 */ |
283 |
} |
} |
284 |
|
|
285 |
void GC_start_world() |
void GC_start_world() |