mirror of https://github.com/apache/activemq.git
use a tighter wait() based on the remaining time
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@360323 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
14f96a9e6f
commit
77dd8fb71d
|
@ -125,11 +125,11 @@ public class MessageIdList extends Assert implements MessageListener {
|
|||
break;
|
||||
}
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
if (duration > maximumDuration ) {
|
||||
if (duration >= maximumDuration ) {
|
||||
break;
|
||||
}
|
||||
synchronized (semaphore) {
|
||||
semaphore.wait(4000);
|
||||
semaphore.wait(maximumDuration-duration);
|
||||
}
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
|
|
Loading…
Reference in New Issue