Monitor owner state check correctly.
Monitor can be owned at the beginning of this method.
This commit is contained in:
parent
2407e89725
commit
4a30fabfcf
@ -32,6 +32,7 @@ module Kernel
|
|||||||
# that file has already been loaded is preserved.
|
# that file has already been loaded is preserved.
|
||||||
|
|
||||||
def require(path)
|
def require(path)
|
||||||
|
monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
|
||||||
RUBYGEMS_ACTIVATION_MONITOR.enter
|
RUBYGEMS_ACTIVATION_MONITOR.enter
|
||||||
|
|
||||||
path = path.to_path if path.respond_to? :to_path
|
path = path.to_path if path.respond_to? :to_path
|
||||||
@ -166,7 +167,7 @@ module Kernel
|
|||||||
|
|
||||||
raise load_error
|
raise load_error
|
||||||
ensure
|
ensure
|
||||||
if RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
|
if !monitor_owned && RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
|
||||||
STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
|
STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
|
||||||
raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR is holding."
|
raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR is holding."
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user