[前][次][番号順一覧][スレッド一覧]

ruby-changes:64277

From: Koichi <ko1@a...>
Date: Fri, 18 Dec 2020 18:00:32 +0900 (JST)
Subject: [ruby-changes:64277] 74ab2c3b46 (master): finalizing should be checked before VM lock

https://git.ruby-lang.org/ruby.git/commit/?id=74ab2c3b46

From 74ab2c3b463da4d98803fe694acad831938a97e5 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Fri, 18 Dec 2020 17:59:26 +0900
Subject: finalizing should be checked before VM lock


diff --git a/gc.c b/gc.c
index 91a9aeb..a8b0b4f 100644
--- a/gc.c
+++ b/gc.c
@@ -3724,10 +3724,11 @@ finalize_deferred(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L3724
 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);
     }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]