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
7
thread.c
7
thread.c
@ -424,13 +424,6 @@ rb_vm_gvl_destroy(rb_global_vm_lock_t *gvl)
|
|||||||
{
|
{
|
||||||
gvl_release(gvl);
|
gvl_release(gvl);
|
||||||
gvl_destroy(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
|
void
|
||||||
|
2
vm.c
2
vm.c
@ -2664,6 +2664,8 @@ ruby_vm_destruct(rb_vm_t *vm)
|
|||||||
if (objspace) {
|
if (objspace) {
|
||||||
rb_objspace_free(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() */
|
/* after freeing objspace, you *can't* use ruby_xfree() */
|
||||||
ruby_mimfree(vm);
|
ruby_mimfree(vm);
|
||||||
ruby_current_vm_ptr = NULL;
|
ruby_current_vm_ptr = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user