MCPcopy Create free account
hub / github.com/e2wugui/zeze / close

Method close

ZezeJava/ZezeJava/src/main/java/Zeze/Net/Selector.java:142–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

140 }
141
142 public void close() {
143 if (Thread.currentThread() == this) {
144 Task.getCriticalThreadPool().execute(this::close);
145 return;
146 }
147
148 running = false;
149 selector.wakeup();
150
151 try {
152 join();
153 } catch (Exception e) {
154 logger.error("wait selector thread {} exception:", getClass().getName(), e);
155 }
156
157 try {
158 selector.close();
159 } catch (Exception e) {
160 logger.error("selector.close {} exception:", getClass().getName(), e);
161 }
162 }
163
164 private static final class WakeupThread {
165 private static final ArrayBlockingQueue<java.nio.channels.Selector> wakeupQueue = new ArrayBlockingQueue<>(256);

Callers

nothing calls this directly

Calls 6

getCriticalThreadPoolMethod · 0.95
joinMethod · 0.80
getNameMethod · 0.65
closeMethod · 0.65
executeMethod · 0.45
wakeupMethod · 0.45

Tested by

no test coverage detected