diff options
author | Koichi Sasada <[email protected]> | 2020-12-18 17:59:26 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-12-18 17:59:26 +0900 |
commit | 74ab2c3b463da4d98803fe694acad831938a97e5 (patch) | |
tree | bc8d7e85d3861b0818164ac820535440e987a8e3 /gc.c | |
parent | 7d32bf78537eaeb046166b45a79b47316ccf6f02 (diff) |
finalizing should be checked before VM lock
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); } |