8231603: (se) Selector implementations do not need to use cancelledKeys
Alan Bateman
Alan.Bateman at oracle.com
Tue Oct 1 14:48:51 UTC 2019
This is a change to the Selector and SelectionKey::cancel
implementations to avoid needing the cancelled-key set. Although
specified, the cancelled-set key is not exposed in the API (except in
implementations of AbstractSelector where the implementation has access
to its own cancelled-key set) so the change should not be observable.
The change has no impact on alternative implementations of
AbstractSelector. While in the area, I replaced the use of
AtomicBoolean for the open state with a VarHandle. I also inverted the
valid flag in SelectionKeyImpl to that its initial value is false and so
doesn't need to be initialized to true with a volatile write.
http://cr.openjdk.java.net/~alanb/8231603/webrev/index.html
-Alan
More information about the nio-dev
mailing list