Search in sources :

Example 6 with AbstractSelectionKey

use of java.nio.channels.spi.AbstractSelectionKey in project XobotOS by xamarin.

the class SelectorImpl method implCloseSelector.

@Override
protected void implCloseSelector() throws IOException {
    wakeup();
    synchronized (this) {
        synchronized (unmodifiableKeys) {
            synchronized (selectedKeys) {
                IoUtils.close(wakeupIn);
                IoUtils.close(wakeupOut);
                doCancel();
                for (SelectionKey sk : mutableKeys) {
                    deregister((AbstractSelectionKey) sk);
                }
            }
        }
    }
}
Also used : AbstractSelectionKey(java.nio.channels.spi.AbstractSelectionKey) SelectionKey(java.nio.channels.SelectionKey)

Aggregations

SelectionKey (java.nio.channels.SelectionKey)6 AbstractSelectionKey (java.nio.channels.spi.AbstractSelectionKey)6