Skip to content

Commit

Permalink
protect edge future against ConcurrencyError form JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Jul 29, 2016
1 parent db7c21f commit d8c81c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/concurrent/edge/future.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,14 @@ def wait_until_complete(timeout)

@Lock.synchronize do
@Waiters.increment
unless completed?
@Condition.wait @Lock, timeout
begin
unless completed?
@Condition.wait @Lock, timeout
end
ensure
# JRuby may raise ConcurrencyError
@Waiters.decrement
end
@Waiters.decrement
end
completed?
end
Expand Down

0 comments on commit d8c81c5

Please sign in to comment.