summaryrefslogtreecommitdiffstats
path: root/jrt
diff options
context:
space:
mode:
Diffstat (limited to 'jrt')
-rw-r--r--jrt/src/com/yahoo/jrt/TransportThread.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/jrt/src/com/yahoo/jrt/TransportThread.java b/jrt/src/com/yahoo/jrt/TransportThread.java
index 8f4f49b8888..bb41e67c3f1 100644
--- a/jrt/src/com/yahoo/jrt/TransportThread.java
+++ b/jrt/src/com/yahoo/jrt/TransportThread.java
@@ -331,13 +331,14 @@ public class TransportThread {
parent.notifyDone(this);
}
- TransportThread shutdown() {
- synchronized (this) {
- if (state == OPEN) {
- state = CLOSING;
- selector.wakeup();
- }
+ private synchronized void handleShutdown() {
+ if (state == OPEN) {
+ state = CLOSING;
}
+ }
+
+ TransportThread shutdown() {
+ postCommand(this::handleShutdown);
return this;
}