diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-12-23 15:45:09 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-12-23 16:50:17 +0900 |
commit | 2da53b14686d07369486bf435c5de932bf26a9fd (patch) | |
tree | e698a401d75288e4ef269cf0cc9f887a9275c7d6 | |
parent | ca032d5eeaf81692f89f35c55450dcb97df59e16 (diff) | |
download | ruby-2da53b14686d07369486bf435c5de932bf26a9fd.tar.gz |
`finalize_deferred` doesn't need VM lock
`finalize_list()` acquires VM lock to manipulate objspace state.
-rw-r--r-- | gc.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -4071,12 +4071,8 @@ gc_finalize_deferred(void *dmy) rb_objspace_t *objspace = dmy; if (ATOMIC_EXCHANGE(finalizing, 1)) return; - RB_VM_LOCK_ENTER(); - { - finalize_deferred(objspace); - ATOMIC_SET(finalizing, 0); - } - RB_VM_LOCK_LEAVE(); + finalize_deferred(objspace); + ATOMIC_SET(finalizing, 0); } static void |