summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-11 21:49:21 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-11 21:49:21 +0900
commitf1f27da6c457684fdbfc0352297e6847f675ce4c (patch)
tree018bff0151b583fa6808a371c9f879c788fcbdc4 /lib/rubygems/core_ext
parent8b27c23b5d55bd707a89bb5d95d2bdba9e132c1a (diff)
Revert "Try to revert the test failure with Ruby CI"
This reverts commit 8b27c23b5d55bd707a89bb5d95d2bdba9e132c1a.
Diffstat (limited to 'lib/rubygems/core_ext')
-rw-r--r--lib/rubygems/core_ext/kernel_gem.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rubygems/core_ext/kernel_gem.rb b/lib/rubygems/core_ext/kernel_gem.rb
index fb3053f..e722225 100644
--- a/lib/rubygems/core_ext/kernel_gem.rb
+++ b/lib/rubygems/core_ext/kernel_gem.rb
@@ -61,9 +61,13 @@ module Kernel
spec = dep.to_spec
- Gem::LOADED_SPECS_MUTEX.synchronize do
- spec.activate
- end if spec
+ if spec
+ if Gem::LOADED_SPECS_MUTEX.owned?
+ spec.activate
+ else
+ Gem::LOADED_SPECS_MUTEX.synchronize { spec.activate }
+ end
+ end
end
private :gem