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:
Hiram R. Chirino 2005-12-31 16:48:55 +00:00
parent 14f96a9e6f
commit 77dd8fb71d
1 changed files with 2 additions and 2 deletions

View File

@ -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) {