diff options
author | HÃ¥vard Pettersen <3535158+havardpe@users.noreply.github.com> | 2021-12-16 15:01:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 15:01:05 +0100 |
commit | 781d75fea7f5e6bb391267201adbf5c4598526d4 (patch) | |
tree | 3028f218ccaf557365c4d6623e8dbe501586179c /jrt | |
parent | 54327a0e714ef00b71007f7bef9f0f79a4d187fa (diff) | |
parent | 7c39445c2fed8055231a23347d207f3dd5ede6b4 (diff) |
Merge pull request #20547 from vespa-engine/havardpe/transport-prod
add ability to wake up the transport thread explicitly
Diffstat (limited to 'jrt')
-rw-r--r-- | jrt/src/com/yahoo/jrt/TransportThread.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/jrt/src/com/yahoo/jrt/TransportThread.java b/jrt/src/com/yahoo/jrt/TransportThread.java index 4f951ad8259..a3f1773c814 100644 --- a/jrt/src/com/yahoo/jrt/TransportThread.java +++ b/jrt/src/com/yahoo/jrt/TransportThread.java @@ -269,6 +269,23 @@ public class TransportThread { } /** + * Wake up this transport thread explicitly. + **/ + public void wakeup() { + selector.wakeup(); + } + + /** + * Wake up this transport thread explicitly, but only if the + * calling thread is not the transport thread itself. + **/ + public void wakeup_if_not_self() { + if (Thread.currentThread() != thread) { + wakeup(); + } + } + + /** * Synchronize with the transport thread. This method will block * until all commands issued before this method was invoked has * completed. If the transport thread has been shut down (or is in |