Skip to content

Commit 5661189

Browse files
committed
Monotonic Condition::clock_time for JRuby 1.7.x
1 parent 2cb80dd commit 5661189

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/concurrent/atomic/condition.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ def broadcast
7272
def clock_time
7373
Process.clock_gettime Process::CLOCK_MONOTONIC
7474
end
75+
elsif RUBY_PLATFORM == 'java'
76+
def clock_time
77+
java.lang.System.nanoTime() / 1_000_000_000.0
78+
end
7579
else
7680
def clock_time
7781
Time.now.to_f
7882
end
7983
end
80-
8184
end
8285
end

0 commit comments

Comments
 (0)