mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Destroy VM-wise locks before freeing [Bug #15852]
This commit is contained in:
parent
7110795f37
commit
2a83650b0f
Notes:
git
2021-03-09 20:11:58 +09:00
2 changed files with 2 additions and 7 deletions
7
thread.c
7
thread.c
|
@ -424,13 +424,6 @@ rb_vm_gvl_destroy(rb_global_vm_lock_t *gvl)
|
|||
{
|
||||
gvl_release(gvl);
|
||||
gvl_destroy(gvl);
|
||||
|
||||
if (0) {
|
||||
rb_vm_t *vm = GET_VM();
|
||||
/* may be held by running threads */
|
||||
rb_native_mutex_destroy(&vm->waitpid_lock);
|
||||
rb_native_mutex_destroy(&vm->workqueue_lock);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
2
vm.c
2
vm.c
|
@ -2664,6 +2664,8 @@ ruby_vm_destruct(rb_vm_t *vm)
|
|||
if (objspace) {
|
||||
rb_objspace_free(objspace);
|
||||
}
|
||||
rb_native_mutex_destroy(&vm->waitpid_lock);
|
||||
rb_native_mutex_destroy(&vm->workqueue_lock);
|
||||
/* after freeing objspace, you *can't* use ruby_xfree() */
|
||||
ruby_mimfree(vm);
|
||||
ruby_current_vm_ptr = NULL;
|
||||
|
|
Loading…
Reference in a new issue