mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
finalize_deferred
doesn't need VM lock
`finalize_list()` acquires VM lock to manipulate objspace state.
This commit is contained in:
parent
ca032d5eea
commit
2da53b1468
Notes:
git
2021-12-23 16:50:37 +09:00
1 changed files with 2 additions and 6 deletions
4
gc.c
4
gc.c
|
@ -4071,13 +4071,9 @@ gc_finalize_deferred(void *dmy)
|
||||||
rb_objspace_t *objspace = dmy;
|
rb_objspace_t *objspace = dmy;
|
||||||
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
|
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
|
||||||
|
|
||||||
RB_VM_LOCK_ENTER();
|
|
||||||
{
|
|
||||||
finalize_deferred(objspace);
|
finalize_deferred(objspace);
|
||||||
ATOMIC_SET(finalizing, 0);
|
ATOMIC_SET(finalizing, 0);
|
||||||
}
|
}
|
||||||
RB_VM_LOCK_LEAVE();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gc_finalize_deferred_register(rb_objspace_t *objspace)
|
gc_finalize_deferred_register(rb_objspace_t *objspace)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue