mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
Only enabled mon_owned condition with Ruby 2.5+
This commit is contained in:
parent
3bf8ffad71
commit
f36a53d038
1 changed files with 8 additions and 4 deletions
|
@ -32,7 +32,9 @@ 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?
|
if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
|
||||||
|
monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
|
||||||
|
end
|
||||||
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
|
||||||
|
@ -167,9 +169,11 @@ module Kernel
|
||||||
|
|
||||||
raise load_error
|
raise load_error
|
||||||
ensure
|
ensure
|
||||||
if monitor_owned != (ow = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?)
|
if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
|
||||||
STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
|
if monitor_owned != (ow = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?)
|
||||||
raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before #{monitor_owned} -> after #{ow}"
|
STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $!
|
||||||
|
raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before #{monitor_owned} -> after #{ow}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue