mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
thread_pthread.c (gvl_destroy): make no-op on GVL bits
It's possible for another thread to take vm->gvl.lock during gvl_release at the end of thread_start_func_2 during VM shutdown, at least. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4514362948
commit
95cae74817
1 changed files with 10 additions and 3 deletions
|
@ -208,9 +208,16 @@ gvl_init(rb_vm_t *vm)
|
||||||
static void
|
static void
|
||||||
gvl_destroy(rb_vm_t *vm)
|
gvl_destroy(rb_vm_t *vm)
|
||||||
{
|
{
|
||||||
rb_native_cond_destroy(&vm->gvl.switch_wait_cond);
|
/*
|
||||||
rb_native_cond_destroy(&vm->gvl.switch_cond);
|
* only called once at VM shutdown (not atfork), another thread
|
||||||
rb_native_mutex_destroy(&vm->gvl.lock);
|
* may still grab vm->gvl.lock when calling gvl_release at
|
||||||
|
* the end of thread_start_func_2
|
||||||
|
*/
|
||||||
|
if (0) {
|
||||||
|
rb_native_cond_destroy(&vm->gvl.switch_wait_cond);
|
||||||
|
rb_native_cond_destroy(&vm->gvl.switch_cond);
|
||||||
|
rb_native_mutex_destroy(&vm->gvl.lock);
|
||||||
|
}
|
||||||
clear_thread_cache_altstack();
|
clear_thread_cache_altstack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue