343344345346347348349350351352353
synchronized (incoming) { Waiter w = new Waiter(incoming, 30000); while (w.hasTime() && incoming.size() < 4) { w.await(); } assertEquals(4, incoming.size()); assertEquals("ECHO 1", incoming.get(0).getBodyString()); assertEquals(0, incoming.get(0).getId());
565566567568569570571572573574575
if (!current.equals(resumer)) { Waiter w = new Waiter(commands, timeout); while (w.hasTime() && (state != OPEN && state != CLOSED)) { w.await(); } } } switch (state)
633634635636637638639640641642643
{ e.rethrow(); } } } w.await(); } } if (state == CLOSED) {
753754755756757758759760761762763
Waiter w = new Waiter(commands, timeout); while (w.hasTime() && state != CLOSED && lt(maxComplete, point)) { log.debug("%s waiting for[%d]: %d, %s", this, point, maxComplete, commands); w.await(); } if (lt(maxComplete, point)) { if (state != CLOSED)
947948949950951952953954955956957
protected void awaitClose() { Waiter w = new Waiter(commands, timeout); while (w.hasTime() && state != CLOSED) { w.await(); } if (state != CLOSED) { throw new SessionException("close() timed out");
870871872873874875876877878879880
{ Waiter w = new Waiter(this, timeout); while (w.hasTime() && state != CLOSED && !isDone()) { log.debug("%s waiting for result: %s", Session.this, this); w.await(); } } if (isDone()) {
244245246247248249250251252253254
send(new ProtocolHeader(1, 0, 10)); Waiter w = new Waiter(lock, timeout); while (w.hasTime() && state == OPENING && error == null) { w.await(); } if (error != null) { ConnectionException t = error;
319320321322323324325326327328329
synchronized (lock) { Waiter w = new Waiter(lock, timeout); while (w.hasTime() && state != OPEN && error == null) { w.await(); } if (state != OPEN) { throw new ConnectionException("Timed out waiting for connection to be ready. Current state is :" + state);
582583584585586587588589590591592
state = CLOSING; connectionClose(replyCode, replyText, _options); Waiter w = new Waiter(lock, timeout); while (w.hasTime() && state == CLOSING && error == null) { w.await(); } if (error != null) { close(replyCode, replyText, _options);
611612613614615616617618619620621
{ sender.close(); w = new Waiter(lock, timeout); while (w.hasTime() && sender != null && error == null) { w.await(); } if (error != null) { throw new ConnectionException(error);