mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
finalizing should be checked before VM lock
This commit is contained in:
parent
7d32bf7853
commit
74ab2c3b46
1 changed files with 3 additions and 2 deletions
5
gc.c
5
gc.c
|
@ -3724,10 +3724,11 @@ finalize_deferred(rb_objspace_t *objspace)
|
|||
static void
|
||||
gc_finalize_deferred(void *dmy)
|
||||
{
|
||||
rb_objspace_t *objspace = dmy;
|
||||
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
|
||||
|
||||
RB_VM_LOCK_ENTER();
|
||||
{
|
||||
rb_objspace_t *objspace = dmy;
|
||||
if (ATOMIC_EXCHANGE(finalizing, 1)) return;
|
||||
finalize_deferred(objspace);
|
||||
ATOMIC_SET(finalizing, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue