Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'Branch_JGroups_2_12' of github.com:belaban/JGroups into…

… Branch_JGroups_2_12
  • Loading branch information...
commit 0a2d2ca782f4c6f7539d64e5de5355d330f2ee93 2 parents dded151 + 6c12043
@belaban authored
Showing with 27 additions and 20 deletions.
  1. +27 −20 src/org/jgroups/protocols/pbcast/FLUSH.java
View
47 src/org/jgroups/protocols/pbcast/FLUSH.java
@@ -311,26 +311,33 @@ private Object handleConnect(Event evt, boolean waitForUnblock) {
}
private void blockMessageDuringFlush() {
- boolean shouldSuspendByItself = false;
- blockMutex.lock();
- try {
- while (isBlockingFlushDown) {
- if (log.isDebugEnabled())
- log.debug(localAddress + ": blocking for " + (timeout <= 0 ? "ever" : timeout + "ms"));
- shouldSuspendByItself = !notBlockedDown.await(timeout, TimeUnit.MILLISECONDS);
- }
- if (shouldSuspendByItself) {
- isBlockingFlushDown = false;
- log.warn(localAddress + ": unblocking after " + timeout + "ms");
- flush_promise.setResult(Boolean.TRUE);
- notBlockedDown.signalAll();
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- } finally {
- blockMutex.unlock();
- }
- }
+ boolean shouldSuspendByItself = false;
+ blockMutex.lock();
+ try {
+ while (isBlockingFlushDown) {
+ if (log.isDebugEnabled())
+ log.debug(localAddress + ": blocking for " + (timeout <= 0 ? "ever" : timeout + "ms"));
+ if(timeout <= 0) {
+ notBlockedDown.await();
+ }
+ else {
+ shouldSuspendByItself = !notBlockedDown.await(timeout, TimeUnit.MILLISECONDS);
+ }
+
+ if (shouldSuspendByItself) {
+ isBlockingFlushDown = false;
+ log.warn(localAddress + ": unblocking after " + timeout + "ms");
+ flush_promise.setResult(Boolean.TRUE);
+ notBlockedDown.signalAll();
+ }
+ }
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ } finally {
+ blockMutex.unlock();
+ }
+ }
+
public Object up(Event evt) {
Please sign in to comment.
Something went wrong with that request. Please try again.