2003-09-25 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Thu, 25 Sep 2003 17:09:23 +0000 (17:09 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Thu, 25 Sep 2003 17:09:23 +0000 (17:09 +0000)
* 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

libjava/ChangeLog
libjava/gnu/java/nio/SelectorImpl.java
libjava/gnu/java/nio/natSelectorImpl.cc

index 48b2145d4992559e0b3386c4cdaf897ebc235301..6271be408a4d0c6d08c859a13516116dbf2f2347 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2003-09-25  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/nio/SelectorImpl.java
index b2c2d87c5a7e62b809d387e2abfd01ce8734664d..ea2ceda71e9f8ca412fd65bcb5e883f0f85677dc 100644 (file)
@@ -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()
index 208aa0595087f173e502b9f8f640cffbbd1223e8..764167aaee2e37a932b66c9af4f0c31c9e37e341 100644 (file)
@@ -42,8 +42,8 @@ helper_get_filedescriptors (jintArray& fdArray, fd_set fds)
 }
 
 jint
-gnu::java::nio::SelectorImpl::java_do_select (jintArray read, jintArray write,
-                                              jintArray except, jlong timeout)
+gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
+                                          jintArray except, jlong timeout)
 {
   jint result;
   int max_fd = 0;