Skip to content

Commit 4b6d2b9

Browse files
committed
Removed unnecessary #mutex calls in Delay.
1 parent 5f2b1fd commit 4b6d2b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/concurrent/delay.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def value(timeout = nil)
7878
else
7979
# this function has been optimized for performance and
8080
# should not be modified without running new benchmarks
81-
mutex.synchronize do
81+
synchronize do
8282
execute = @computing = true unless @computing
8383
if execute
8484
begin
@@ -140,7 +140,7 @@ def wait(timeout = nil)
140140
# @yield the delayed operation to perform
141141
# @return [true, false] if success
142142
def reconfigure(&block)
143-
mutex.synchronize do
143+
synchronize do
144144
raise ArgumentError.new('no block given') unless block_given?
145145
unless @computing
146146
@task = block
@@ -170,7 +170,7 @@ def execute_task_once # :nodoc:
170170
# this function has been optimized for performance and
171171
# should not be modified without running new benchmarks
172172
execute = task = nil
173-
mutex.synchronize do
173+
synchronize do
174174
execute = @computing = true unless @computing
175175
task = @task
176176
end
@@ -183,7 +183,7 @@ def execute_task_once # :nodoc:
183183
rescue => ex
184184
reason = ex
185185
end
186-
mutex.synchronize do
186+
synchronize do
187187
set_state(success, result, reason)
188188
event.set
189189
end

0 commit comments

Comments
 (0)