diff options
author | Neil Fuller <nfuller@google.com> | 2015-01-14 14:49:36 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-14 14:49:37 +0000 |
commit | 3cdad0e18459a53bdf7e33c6509244a5928cefa5 (patch) | |
tree | c20daaf0c6cc2055d84a416d1cb79c7e585d870d | |
parent | 1a923668463640b1e0cbdc9d90bc4530240fc75d (diff) | |
parent | 9944af27afcb5d58293b4fd158abf6853505d4f5 (diff) | |
download | libcore-3cdad0e18459a53bdf7e33c6509244a5928cefa5.tar.gz libcore-3cdad0e18459a53bdf7e33c6509244a5928cefa5.tar.bz2 libcore-3cdad0e18459a53bdf7e33c6509244a5928cefa5.zip |
Merge "Fix confusing Selector docs"
-rw-r--r-- | luni/src/main/java/java/nio/channels/Selector.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/luni/src/main/java/java/nio/channels/Selector.java b/luni/src/main/java/java/nio/channels/Selector.java index 6d9b06369..baa6a7f03 100644 --- a/luni/src/main/java/java/nio/channels/Selector.java +++ b/luni/src/main/java/java/nio/channels/Selector.java @@ -78,8 +78,11 @@ public abstract class Selector implements Closeable { public abstract boolean isOpen(); /** - * Gets the set of registered keys. The set is immutable and is not thread- - * safe. + * Gets the set of registered keys. + * + * <p>The returned set cannot be changed directly but can be modified + * indirectly by operations on the Selector. It should therefore not be + * treated as thread-safe. * * @return the set of registered keys. */ @@ -127,9 +130,11 @@ public abstract class Selector implements Closeable { public abstract int select(long timeout) throws IOException; /** - * Gets the selection keys whose channels are ready for operation. The set - * is not thread-safe and no keys may be added to it. Removing keys is - * allowed. + * Gets the selection keys whose channels are ready for operation. + * + * <p>Keys cannot be added to the set directly. Keys can be removed. + * The set can be modified indirectly by operations on the Selector. It + * should therefore not be treated as thread-safe. * * @return the selection keys whose channels are ready for operation. * @throws ClosedSelectorException |