instance method
Thread::Mutex#lock
() -> self
mutex.lock → self
thread_sync.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/thread_sync.rb, line 100
def lock
Primitive.rb_mut_lock
end
Attempts to grab the lock and waits if it isn’t available. Raises ThreadError if mutex was locked by the current thread.