We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36ae16c commit 4d0ea8aCopy full SHA for 4d0ea8a
1 file changed
lib/concurrent-ruby/concurrent/thread_safe/util/cheap_lockable.rb
@@ -54,14 +54,14 @@ def cheap_broadcast
54
extend Volatile
55
attr_volatile :mutex
56
57
- # Non-reentrant Mutex#syncrhonize
+ # Non-reentrant Mutex#synchronize
58
def cheap_synchronize
59
true until (my_mutex = mutex) || cas_mutex(nil, my_mutex = Mutex.new)
60
my_mutex.synchronize { yield }
61
end
62
63
# Releases this object's +cheap_synchronize+ lock and goes to sleep waiting for other threads to +cheap_broadcast+, reacquires the lock on wakeup.
64
- # Must only be called in +cheap_broadcast+'s block.
+ # Must only be called in +cheap_synchronize+'s block.
65
def cheap_wait
66
conditional_variable = @conditional_variable ||= ConditionVariable.new
67
conditional_variable.wait(mutex)
0 commit comments