1
0
Fork 0
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:
Nobuyoshi Nakada 2021-02-19 11:40:37 +09:00
parent 7110795f37
commit 2a83650b0f
Notes: git 2021-03-09 20:11:58 +09:00
2 changed files with 2 additions and 7 deletions

View file

@ -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
View file

@ -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;