978979980981982983984985986987988
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");
901902903904905906907908909910911
{ 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()) {
307308309310311312313314315316317
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());
568569570571572573574575576577578
if (!current.equals(resumer)) { Waiter w = new Waiter(commands, timeout); while (w.hasTime() && (state != OPEN && state != CLOSED)) { w.await(); } } } switch (state)
636637638639640641642643644645646
{ e.rethrow(); } } } w.await(); } } if (state == CLOSED) {
756757758759760761762763764765766
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)
950951952953954955956957958959960
873874875876877878879880881882883
245246247248249250251252253254255
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;
320321322323324325326327328329330
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);