diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-09 17:34:10 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-09 17:34:10 +0000 |
commit | 0265b721e9468ea54315b4c759ed894057d6c6d4 (patch) | |
tree | 3d255b674b1d9f300d842c3696c2bef6cd9f7869 /libjava/java/nio/channels/spi/AbstractSelectionKey.java | |
parent | 6e82c5c2ec51f97ebf3f43529499a0c312b23f6f (diff) | |
download | ppe42-gcc-0265b721e9468ea54315b4c759ed894057d6c6d4.tar.gz ppe42-gcc-0265b721e9468ea54315b4c759ed894057d6c6d4.zip |
2003-10-09 Michael Koch <konqueror@gmx.de>
* java/nio/channels/spi/AbstractSelectableChannel.java
(registered): Made private.
(blocking): Likewise.
(LOCK): Likewise.
(provider): Likewise.
(keys): Made it a private LinkedList.
(AbstractSelectableChannel): Initialize keys.
(isRegistered): New implementation.
(locate): Rewritten.
(register): Rewritten.
* java/nio/channels/spi/AbstractSelectionKey.java
(ok): Removed.
(cancelled): New member variable.
(cancel): Rewritten.
(isValid): Rewritten.
* java/nio/channels/spi/AbstractSelector.java:
Some methods moved.
(closed): Make private.
(provider): Likewise.
(cancelledKeys): New member variable.
(AbstractSelector): Initialize cancelledKeys.
(cancelKey): New method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72275 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/nio/channels/spi/AbstractSelectionKey.java')
-rw-r--r-- | libjava/java/nio/channels/spi/AbstractSelectionKey.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libjava/java/nio/channels/spi/AbstractSelectionKey.java b/libjava/java/nio/channels/spi/AbstractSelectionKey.java index 01ea4f33fc2..0cd5ee104e1 100644 --- a/libjava/java/nio/channels/spi/AbstractSelectionKey.java +++ b/libjava/java/nio/channels/spi/AbstractSelectionKey.java @@ -1,5 +1,5 @@ /* AbstractSelectionKey.java -- - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -45,7 +45,7 @@ import java.nio.channels.SelectionKey; public abstract class AbstractSelectionKey extends SelectionKey { - boolean ok = true; + private boolean cancelled = false; /** * Initializes the key. @@ -59,10 +59,12 @@ public abstract class AbstractSelectionKey */ public final void cancel () { - if (ok) - selector ().selectedKeys ().add (this); - - ok = false; + if (isValid()) + { + // FIXME: implement this. + //selector().cancelledKeys().add (this); + cancelled = true; + } } /** @@ -70,6 +72,6 @@ public abstract class AbstractSelectionKey */ public final boolean isValid () { - return ok; + return !cancelled; } } |