aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java/nio/SelectorImpl.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2003-09-25 17:09:23 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2003-09-25 17:09:23 +0000
commitc5fd8041edf6b962e51e223ceac5a70fdf68150a (patch)
treed14893a589c702f1d16b89d615ca468c7044394c /libjava/gnu/java/nio/SelectorImpl.java
parent465ad0c7120cda4a1215c14f30e3b418ab89b1a4 (diff)
downloadgcc-c5fd8041edf6b962e51e223ceac5a70fdf68150a.zip
gcc-c5fd8041edf6b962e51e223ceac5a70fdf68150a.tar.gz
gcc-c5fd8041edf6b962e51e223ceac5a70fdf68150a.tar.bz2
2003-09-25 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/SelectorImpl.java (implSelect): Renamed from java_do_select. (select): Call native implSelect() and add support for Thread interruption. * gnu/java/nio/natSelectorImpl.cc (implSelect): Renamed from java_do_select. From-SVN: r71781
Diffstat (limited to 'libjava/gnu/java/nio/SelectorImpl.java')
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
index b2c2d87..ea2ceda 100644
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ b/libjava/gnu/java/nio/SelectorImpl.java
@@ -93,8 +93,8 @@ public class SelectorImpl extends AbstractSelector
}
// A timeout value of -1 means block forever.
- private static native int java_do_select (int[] read, int[] write,
- int[] except, long timeout);
+ private static native int implSelect (int[] read, int[] write,
+ int[] except, long timeout);
private final int[] getFDsAsArray (int ops)
{
@@ -143,18 +143,18 @@ public class SelectorImpl extends AbstractSelector
return 0;
}
- int ret = 0;
-
deregisterCancelledKeys();
// Set only keys with the needed interest ops into the arrays.
int[] read = getFDsAsArray (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT);
int[] write = getFDsAsArray (SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT);
int[] except = new int [0]; // FIXME: We dont need to check this yet
-
- // Call the native select () on all file descriptors.
int anzahl = read.length + write.length + except.length;
- ret = java_do_select (read, write, except, timeout);
+
+ // Call the native select() on all file descriptors.
+ begin();
+ int result = implSelect (read, write, except, timeout);
+ end();
Iterator it = keys.iterator ();
@@ -216,7 +216,7 @@ public class SelectorImpl extends AbstractSelector
}
deregisterCancelledKeys();
- return ret;
+ return result;
}
public final Set selectedKeys()