Update Java IO.md

补充 select() 被 wakeup() 或中断唤醒时可能返回 0。
This commit is contained in:
CyC2018
2026-10-31 00:23:18 +08:00
parent 4376092aa5
commit d015559a07
+1 -1
View File
@@ -455,7 +455,7 @@ int interestSet = SelectionKey.OP_READ | SelectionKey.OP_WRITE;
int num = selector.select();
```
使用 select() 来监听到达的事件,它会一直阻塞直到有至少一个事件到达。
使用 select() 来监听到达的事件,它会阻塞到至少一个通道就绪,或者被 wakeup() 或线程中断唤醒,因此返回值可能为 0。
#### 4. 获取到达的事件