Skip to content

Commit 96fae99

Browse files
committed
Fixed bug when passing subsecond times to Java classes.
1 parent a7525e4 commit 96fae99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/concurrent/atomic/count_down_latch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def wait(timeout = nil)
8888
@latch.await
8989
true
9090
else
91-
@latch.await(timeout, java.util.concurrent.TimeUnit::SECONDS)
91+
@latch.await(1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)
9292
end
9393
end
9494

lib/concurrent/executor/executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def shutdown?
191191
#
192192
# @return [Boolean] `true` if shutdown complete or false on `timeout`
193193
def wait_for_termination(timeout)
194-
@executor.awaitTermination(timeout.to_i, java.util.concurrent.TimeUnit::SECONDS)
194+
@executor.awaitTermination(1000 * timeout, java.util.concurrent.TimeUnit::MILLISECONDS)
195195
end
196196

197197
# Begin an orderly shutdown. Tasks already in the queue will be executed,

0 commit comments

Comments
 (0)