Skip to content

Commit d8c81c5

Browse files
committed
protect edge future against ConcurrencyError form JRuby
1 parent db7c21f commit d8c81c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/concurrent/edge/future.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,14 @@ def wait_until_complete(timeout)
399399

400400
@Lock.synchronize do
401401
@Waiters.increment
402-
unless completed?
403-
@Condition.wait @Lock, timeout
402+
begin
403+
unless completed?
404+
@Condition.wait @Lock, timeout
405+
end
406+
ensure
407+
# JRuby may raise ConcurrencyError
408+
@Waiters.decrement
404409
end
405-
@Waiters.decrement
406410
end
407411
completed?
408412
end

0 commit comments

Comments
 (0)