Skip to content

Commit

Permalink
Fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Dec 7, 2023
1 parent 36ae16c commit 4d0ea8a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def cheap_broadcast
extend Volatile
attr_volatile :mutex

# Non-reentrant Mutex#syncrhonize
# Non-reentrant Mutex#synchronize
def cheap_synchronize
true until (my_mutex = mutex) || cas_mutex(nil, my_mutex = Mutex.new)
my_mutex.synchronize { yield }
end

# Releases this object's +cheap_synchronize+ lock and goes to sleep waiting for other threads to +cheap_broadcast+, reacquires the lock on wakeup.
# Must only be called in +cheap_broadcast+'s block.
# Must only be called in +cheap_synchronize+'s block.
def cheap_wait
conditional_variable = @conditional_variable ||= ConditionVariable.new
conditional_variable.wait(mutex)
Expand Down

0 comments on commit 4d0ea8a

Please sign in to comment.