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

ruby-changes:58728

From: Koichi <ko1@a...>
Date: Tue, 12 Nov 2019 09:39:49 +0900 (JST)
Subject: [ruby-changes:58728] 4a30fabfcf (master): Monitor owner state check correctly.

https://git.ruby-lang.org/ruby.git/commit/?id=4a30fabfcf

From 4a30fabfcfd72bd61bf1dad61f168eaba6100f12 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Tue, 12 Nov 2019 09:35:26 +0900
Subject: Monitor owner state check correctly.

Monitor can be owned at the beginning of this method.

diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 944bb93..ccbb2c0 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -32,6 +32,7 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_require.rb#L32
   # that file has already been loaded is preserved.
 
   def require(path)
+    monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
     RUBYGEMS_ACTIVATION_MONITOR.enter
 
     path = path.to_path if path.respond_to? :to_path
@@ -166,7 +167,7 @@ module Kernel https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_require.rb#L167
 
     raise load_error
   ensure
-    if RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
+    if !monitor_owned && RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
       STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
       raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR is holding."
     end
-- 
cgit v0.10.2


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

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