Skip to content

Commit 05523c0

Browse files
committed
Avoid creating a Fiber while loading the gem
* Since creating a Fiber can be quite expensive and might not work on some platforms (though those are bugs): https://bugs.ruby-lang.org/issues/20085 https://bugs.ruby-lang.org/issues/21607 * spec/concurrent/atomic/lock_local_var_spec.rb already checks that the shortcut is correct and matches the reality.
1 parent 4eb01b9 commit 05523c0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/concurrent-ruby/concurrent/atomic/lock_local_var.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Concurrent
66
# @!visibility private
77
def self.mutex_owned_per_thread?
88
return false if Concurrent.on_jruby? || Concurrent.on_truffleruby?
9+
return RUBY_VERSION < "3.0" if Concurrent.on_cruby?
910

1011
mutex = Mutex.new
1112
# Lock the mutex:

0 commit comments

Comments
 (0)