perform all 'state' changes in the transport thread
@@ -331,13 +331,14 @@ public class TransportThread {
parent.notifyDone(this);
}
- TransportThread shutdown() {
- synchronized (this) {
+ private synchronized void handleShutdown() {
if (state == OPEN) {
state = CLOSING;
- selector.wakeup();
}
}
+
+ TransportThread shutdown() {
+ postCommand(this::handleShutdown);
return this;
}
