346 |
all_threads = scm_delq_x (thread, all_threads); |
all_threads = scm_delq_x (thread, all_threads); |
347 |
t->exited = 1; |
t->exited = 1; |
348 |
thread_count--; |
thread_count--; |
349 |
scm_i_plugin_mutex_unlock (&thread_admin_mutex); |
/* detach before unlocking in order to not become joined when detached */ |
|
|
|
350 |
scm_thread_detach (t->thread); |
scm_thread_detach (t->thread); |
351 |
|
scm_i_plugin_mutex_unlock (&thread_admin_mutex); |
352 |
} |
} |
353 |
|
|
354 |
static void * |
static void * |
1262 |
scm_i_plugin_mutex_lock (&t->heap_mutex); |
scm_i_plugin_mutex_lock (&t->heap_mutex); |
1263 |
} |
} |
1264 |
scm_i_thread_go_to_sleep = 0; |
scm_i_thread_go_to_sleep = 0; |
|
scm_i_plugin_mutex_unlock (&thread_admin_mutex); |
|
1265 |
} |
} |
1266 |
} |
} |
1267 |
|
|
1268 |
void |
void |
1269 |
scm_i_thread_invalidate_freelists () |
scm_i_thread_invalidate_freelists () |
1270 |
{ |
{ |
1271 |
/* Don't need to lock thread_admin_mutex here since we are sinle threaded */ |
/* Don't need to lock thread_admin_mutex here since we are single threaded */ |
1272 |
SCM threads = all_threads; |
SCM threads = all_threads; |
1273 |
for (; !SCM_NULLP (threads); threads = SCM_CDR (threads)) |
for (; !SCM_NULLP (threads); threads = SCM_CDR (threads)) |
1274 |
if (SCM_CAR (threads) != cur_thread) |
if (SCM_CAR (threads) != cur_thread) |
1284 |
if (threads_initialized_p && !--gc_section_count) |
if (threads_initialized_p && !--gc_section_count) |
1285 |
{ |
{ |
1286 |
SCM threads; |
SCM threads; |
|
/* Need to lock since woken threads can die and be deleted from list */ |
|
|
scm_i_plugin_mutex_lock (&thread_admin_mutex); |
|
1287 |
threads = all_threads; |
threads = all_threads; |
1288 |
scm_i_plugin_cond_broadcast (&wake_up_cond); |
scm_i_plugin_cond_broadcast (&wake_up_cond); |
1289 |
for (; !SCM_NULLP (threads); threads = SCM_CDR (threads)) |
for (; !SCM_NULLP (threads); threads = SCM_CDR (threads)) |