/[classpath]/classpath/java/nio/channels/spi/AbstractSelectableChannel.java
ViewVC logotype

Diff of /classpath/java/nio/channels/spi/AbstractSelectableChannel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mkoch, Wed Nov 13 11:53:17 2002 UTC revision 1.8 by mkoch, Thu Nov 21 09:12:27 2002 UTC
# Line 78  public abstract class AbstractSelectable Line 78  public abstract class AbstractSelectable
78    {    {
79      synchronized (LOCK)      synchronized (LOCK)
80        {        {
81          blocking = true;          blocking = true;
82          implConfigureBlocking (block);          implConfigureBlocking (block);
83        }        }
84            
85      return this;      return this;
# Line 87  public abstract class AbstractSelectable Line 87  public abstract class AbstractSelectable
87    
88    /**    /**
89     * Closes this channel.     * Closes this channel.
90       *
91       * @exception IOException If an error occurs
92     */     */
93    protected final void implCloseChannel ()    protected final void implCloseChannel ()
94    {    {
# Line 168  public abstract class AbstractSelectable Line 170  public abstract class AbstractSelectable
170    private void add (SelectionKey key)    private void add (SelectionKey key)
171    {    {
172      if (keys == null)      if (keys == null)
173        keys = new LinkedList ();        {
174            keys = new LinkedList ();
175          }
176            
177      keys.add (key);      keys.add (key);
178    }    }
179    
180    /**    /**
181     * Registers this channel with the given selector, returning a selection key.     * Registers this channel with the given selector, returning a selection key.
182       *
183       * @exception ClosedChannelException If the channel is already closed.
184     */     */
185    public final SelectionKey register (Selector selin, int ops, Object att)    public final SelectionKey register (Selector selin, int ops, Object att)
186      throws ClosedChannelException      throws ClosedChannelException
# Line 187  public abstract class AbstractSelectable Line 193  public abstract class AbstractSelectable
193    
194      synchronized (LOCK)      synchronized (LOCK)
195        {        {
196          k = locate (selector);          k = locate (selector);
197    
198          if (k != null)          if (k != null)
199            {            {
200              k.attach (att);              k.attach (att);
201            }            }
202          else          else
203            {            {
204              k = selector.register (this, ops, att);              k = selector.register (this, ops, att);
205                                    
206              if (k != null)              if (k != null)
207                add (k);                add (k);
208            }            }
209        }        }
210    
211      return k;      return k;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26