diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index ccbb2c0472..d2bcc508e5 100644 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -167,9 +167,9 @@ module Kernel raise load_error ensure - if !monitor_owned && RUBYGEMS_ACTIVATION_MONITOR.mon_owned? + if monitor_owned != (ow = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?) STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $! - raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR is holding." + raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before #{monitor_owned} -> after #{ow}" end end