mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-25 05:51:55 -08:00
multithreading: close windows thread handle before releasing exit_barrier in thread_cleanup
Fixes out of memory errors when creating lots of threads on windows, joining them and then again creating many threads (see e.g. the atomic-incf/decf tests).
This commit is contained in:
parent
0080acd4ce
commit
574a90a7c3
1 changed files with 3 additions and 3 deletions
|
|
@ -206,12 +206,12 @@ thread_cleanup(void *aux)
|
|||
#endif
|
||||
process->process.env = NULL;
|
||||
ecl_unlist_process(process);
|
||||
mp_barrier_unblock(3, process->process.exit_barrier, @':disable', ECL_T);
|
||||
ecl_set_process_env(NULL);
|
||||
if (env) _ecl_dealloc_env(env);
|
||||
#ifdef ECL_WINDOWS_THREADS
|
||||
CloseHandle(process->process.thread);
|
||||
#endif
|
||||
mp_barrier_unblock(3, process->process.exit_barrier, @':disable', ECL_T);
|
||||
ecl_set_process_env(NULL);
|
||||
if (env) _ecl_dealloc_env(env);
|
||||
AO_store_release((AO_t*)&process->process.phase, ECL_PROCESS_INACTIVE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue