@@ -9,7 +9,7 @@ module Concurrent
9
9
# queue of length one, or a special kind of mutable variable.
10
10
#
11
11
# On top of the fundamental `#put` and `#take` operations, we also provide a
12
- # `#mutate ` that is atomic with respect to operations on the same instance.
12
+ # `#modify ` that is atomic with respect to operations on the same instance.
13
13
# These operations all support timeouts.
14
14
#
15
15
# We also support non-blocking operations `#try_put!` and `#try_take!`, a
@@ -87,7 +87,7 @@ def borrow(timeout = nil)
87
87
@mutex . synchronize do
88
88
wait_for_full ( timeout )
89
89
90
- # if we timeoud out we'll still be empty
90
+ # If we timed out we'll still be empty
91
91
if unlocked_full?
92
92
yield @value
93
93
else
@@ -116,10 +116,10 @@ def put(value, timeout = nil)
116
116
end
117
117
118
118
# Atomically `take`, yield the value to a block for transformation, and then
119
- # `put` the transformed value. Returns the transformed value. A timeout can
119
+ # `put` the transformed value. Returns the pre-transform value. A timeout can
120
120
# be set to limit the time spent blocked, in which case it returns `TIMEOUT`
121
121
# if the time is exceeded.
122
- # @return [Object] the transformed value, or `TIMEOUT`
122
+ # @return [Object] the pre-transform value, or `TIMEOUT`
123
123
def modify ( timeout = nil )
124
124
raise ArgumentError . new ( 'no block given' ) unless block_given?
125
125
0 commit comments