Clarify the appointment of the intermediate collection
Motivation: An intermediate list is creating in the `EpollEventLoop#closeAll` to prevent ConcurrentModificationException. But this is not the obvious purpose has no comment. Modifications: Add comment to clarify the appointment of the intermediate collection. Result: More clear code.
This commit is contained in:
parent
d3581b575e
commit
016e00bf7a
@ -350,6 +350,8 @@ final class EpollEventLoop extends SingleThreadEventLoop {
|
|||||||
} catch (IOException ignore) {
|
} catch (IOException ignore) {
|
||||||
// ignore on close
|
// ignore on close
|
||||||
}
|
}
|
||||||
|
// Using the intermediate collection to prevent ConcurrentModificationException.
|
||||||
|
// In the `close()` method, the channel is deleted from `channels` map.
|
||||||
Collection<AbstractEpollChannel> array = new ArrayList<AbstractEpollChannel>(channels.size());
|
Collection<AbstractEpollChannel> array = new ArrayList<AbstractEpollChannel>(channels.size());
|
||||||
|
|
||||||
for (AbstractEpollChannel channel: channels.values()) {
|
for (AbstractEpollChannel channel: channels.values()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user