Skip to content

Commit

Permalink
Use tryAcquire since acquire seems prone to racy hangs. :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Jan 20, 2015
1 parent 9a18855 commit f48ebd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyThread.java
Expand Up @@ -1311,7 +1311,7 @@ public Long run(ThreadContext context, Object data) throws InterruptedException

try {
if (millis == 0) {
semaphore.acquire();
semaphore.tryAcquire(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
} else {
semaphore.tryAcquire(millis, TimeUnit.MILLISECONDS);
}
Expand Down

0 comments on commit f48ebd7

Please sign in to comment.