Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
pron committed Oct 10, 2016
1 parent 6945b16 commit 9f59dc4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ public Message receive() throws SuspendExecution, InterruptedException {

Message m;
boolean closed;
Object token = sync.register();
for (int i = 0;; i++) {
closed = isSendClosed(); // must be read BEFORE queue.poll()
if ((m = queue.poll()) != null)
Expand All @@ -368,6 +367,7 @@ public Message receive() throws SuspendExecution, InterruptedException {
setReceiveClosed();
return closeValue();
}
final Object token = sync.register();

sync.await(i);
}
Expand All @@ -392,7 +392,7 @@ public Message receive(long timeout, TimeUnit unit) throws SuspendExecution, Int

Message m;
boolean closed;
Object token = sync.register();
final Object token = sync.register();
try {
for (int i = 0;; i++) {
closed = isSendClosed(); // must be read BEFORE queue.poll()
Expand Down

0 comments on commit 9f59dc4

Please sign in to comment.