instance method
Thread::Mutex#try_lock
() -> bool
mutex.try_lock → true or false
thread_sync.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/thread_sync.rb, line 109
def try_lock
Primitive.rb_mut_trylock
end
Attempts to obtain the lock and returns immediately. Returns true if the lock was granted.