Skip to content

Commit b249301

Browse files
committed
Fixed minor bug in Executor#wait_for_timeout.
1 parent d9b1ba3 commit b249301

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/concurrent/executor/executor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def shutdown?
6363
# thread pool is not running.
6464
def shutdown
6565
mutex.synchronize do
66-
return unless running?
66+
break unless running?
6767
stop_event.set
6868
shutdown_execution
6969
end
@@ -76,7 +76,7 @@ def shutdown
7676
# not running.
7777
def kill
7878
mutex.synchronize do
79-
return if shutdown?
79+
break if shutdown?
8080
stop_event.set
8181
kill_execution
8282
stopped_event.set
@@ -93,8 +93,8 @@ def kill
9393
# @param [Integer] timeout the maximum number of seconds to wait for shutdown to complete
9494
#
9595
# @return [Boolean] `true` if shutdown complete or false on `timeout`
96-
def wait_for_termination(timeout)
97-
stopped_event.wait(timeout.to_f)
96+
def wait_for_termination(timeout = nil)
97+
stopped_event.wait(timeout)
9898
end
9999

100100
protected

0 commit comments

Comments
 (0)