mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
runtime: clear the thread_key before exiting the thread
This commit is contained in:
parent
9dc90531ee
commit
39c3538512
1 changed files with 2 additions and 0 deletions
|
@ -7189,6 +7189,8 @@ void Cyc_exit_thread(void *data, object _, int argc, object * args)
|
|||
gc_remove_mutator(thd);
|
||||
ck_pr_cas_int((int *)&(thd->thread_state), CYC_THREAD_STATE_RUNNABLE,
|
||||
CYC_THREAD_STATE_TERMINATED);
|
||||
// we are exiting, the destructor does not need to be called
|
||||
pthread_setspecific(cyclone_thread_key, (void (*)(void *))NULL);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue