[#2297] Correctly close all registered Channels on EpollEventLoop.closeAll()
This commit is contained in:
parent
c31e8f59ba
commit
3c359cfde5
@ -289,17 +289,11 @@ final class EpollEventLoop extends SingleThreadEventLoop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void closeAll() {
|
private void closeAll() {
|
||||||
int ready = Native.epollWait(epollFd, events, 0);
|
Native.epollWait(epollFd, events, 0);
|
||||||
Collection<AbstractEpollChannel> channels = new ArrayList<AbstractEpollChannel>(ready);
|
Collection<AbstractEpollChannel> channels = new ArrayList<AbstractEpollChannel>(ids.size());
|
||||||
|
|
||||||
for (int i = 0; i < ready; i++) {
|
for (AbstractEpollChannel ch: ids.values()) {
|
||||||
final long ev = events[i];
|
channels.add(ch);
|
||||||
|
|
||||||
int id = (int) (ev >> 32L);
|
|
||||||
AbstractEpollChannel ch = ids.get(id);
|
|
||||||
if (ch != null) {
|
|
||||||
channels.add(ids.get(id));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (AbstractEpollChannel ch: channels) {
|
for (AbstractEpollChannel ch: channels) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user