Don't wait for queued messages if the timeout is negative. This requires a very close timing of when it thinks it should do another loop and when it actually does the loop. Fixes #14.
This commit is contained in:
parent
aa7b199bdb
commit
9c65662997
|
@ -105,8 +105,10 @@ public class User {
|
|||
* @throws InterruptedException
|
||||
*/
|
||||
public void waitForNewMessageNotification(final long timeout) throws InterruptedException {
|
||||
synchronized (queuedMessageSynchronization) {
|
||||
queuedMessageSynchronization.wait(timeout);
|
||||
if (timeout > 0) {
|
||||
synchronized (queuedMessageSynchronization) {
|
||||
queuedMessageSynchronization.wait(timeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue