Skip to content

Commit

Permalink
Clarify the appointment of the intermediate collection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fenik17 authored and Scottmitch committed Jul 6, 2017
1 parent d3581b5 commit 016e00b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ private void closeAll() {
} catch (IOException ignore) {
// 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());

for (AbstractEpollChannel channel: channels.values()) {
Expand Down

0 comments on commit 016e00b

Please sign in to comment.