Skip to content
This repository was archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Fixes #370
Browse files Browse the repository at this point in the history
* Fixes #370
  • Loading branch information
amykang2020 authored Jul 19, 2017
1 parent 7d50f4e commit 4715a46
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,8 @@ public Packet getNextConsumerPacket(ConsumerUID cuid, long timeout)

// add an event listener to wake us up when the consumer is busy
Object lock = c.addEventListener(this,EventType.BUSY_STATE_CHANGED, null);
try {

while (!c.isBusy() || stopped) {
try {
// wait until the consumer is not busy
Expand Down Expand Up @@ -2697,6 +2699,10 @@ public Packet getNextConsumerPacket(ConsumerUID cuid, long timeout)
}
} catch (Exception ex) {}
// remove the event listener since we arent sure if we will care
//c.removeEventListener(lock);
} //while

} finally {
c.removeEventListener(lock);
}
//if (stopped) return null;
Expand Down

0 comments on commit 4715a46

Please sign in to comment.