This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: gnu.java.nio.SelectorImpl
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 25 Sep 2003 19:11:55 +0200
- Subject: FYI: Patch: gnu.java.nio.SelectorImpl
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I commited the attached patch to rename a native method. The old name
was really bad.
Michael
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/cyHfWSOgCCdjSDsRAk67AJ9hS0f4EqN8xJ426lcWXiTuxIJWqACeI1pu
uBYmlxtCyHOcgo0/KiHWrVE=
=Tkg6
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2182
diff -u -b -B -r1.2182 ChangeLog
--- ChangeLog 25 Sep 2003 15:35:20 -0000 1.2182
+++ ChangeLog 25 Sep 2003 17:07:34 -0000
@@ -1,6 +1,15 @@
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
(selectNow): Made final, throws IOException.
(select): Likewise.
(getFDsAsArray): Made final.
Index: gnu/java/nio/SelectorImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/SelectorImpl.java,v
retrieving revision 1.7
diff -u -b -B -r1.7 SelectorImpl.java
--- gnu/java/nio/SelectorImpl.java 25 Sep 2003 15:35:21 -0000 1.7
+++ gnu/java/nio/SelectorImpl.java 25 Sep 2003 17:07:34 -0000
@@ -93,7 +93,7 @@
}
// A timeout value of -1 means block forever.
- private static native int java_do_select (int[] read, int[] write,
+ private static native int implSelect (int[] read, int[] write,
int[] except, long timeout);
private final int[] getFDsAsArray (int ops)
@@ -143,18 +143,18 @@
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 @@
}
deregisterCancelledKeys();
- return ret;
+ return result;
}
public final Set selectedKeys()
Index: gnu/java/nio/natSelectorImpl.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/natSelectorImpl.cc,v
retrieving revision 1.2
diff -u -b -B -r1.2 natSelectorImpl.cc
--- gnu/java/nio/natSelectorImpl.cc 25 Sep 2003 15:35:21 -0000 1.2
+++ gnu/java/nio/natSelectorImpl.cc 25 Sep 2003 17:07:34 -0000
@@ -42,7 +42,7 @@
}
jint
-gnu::java::nio::SelectorImpl::java_do_select (jintArray read, jintArray write,
+gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
jintArray except, jlong timeout)
{
jint result;