6596323: (fc) ClosedByInterruptException not thrown by the interrupt method (lnx)
Reviewed-by: sherman
--- a/jdk/src/share/classes/sun/nio/ch/NativeThreadSet.java Thu Jun 05 14:47:03 2008 +0100
+++ b/jdk/src/share/classes/sun/nio/ch/NativeThreadSet.java Thu Jun 05 14:50:28 2008 +0100
@@ -43,7 +43,7 @@
//
int add() {
long th = NativeThread.current();
- if (th <= 0)
+ if (th == -1)
return -1;
synchronized (this) {
int start = 0;
--- a/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java Thu Jun 05 14:47:03 2008 +0100
+++ b/jdk/src/solaris/classes/sun/nio/ch/NativeThread.java Thu Jun 05 14:50:28 2008 +0100
@@ -34,14 +34,14 @@
// upon which Java threads are built, and defines a simple signal mechanism
// that can be used to release a native thread from a blocking I/O operation.
// On systems that do not require this type of signalling, the current() method
-// always returns zero and the signal(long) method has no effect.
+// always returns -1 and the signal(long) method has no effect.
class NativeThread {
// Returns an opaque token representing the native thread underlying the
// invoking Java thread. On systems that do not require signalling, this
- // method always returns zero.
+ // method always returns -1.
//
static native long current();
--- a/jdk/src/windows/classes/sun/nio/ch/NativeThread.java Thu Jun 05 14:47:03 2008 +0100
+++ b/jdk/src/windows/classes/sun/nio/ch/NativeThread.java Thu Jun 05 14:50:28 2008 +0100
@@ -31,7 +31,7 @@
class NativeThread {
- static long current() { return 0; }
+ static long current() { return -1; }
static void signal(long nt) { }
--- a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java Thu Jun 05 14:47:03 2008 +0100
+++ b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java Thu Jun 05 14:50:28 2008 +0100
@@ -22,7 +22,7 @@
*/
/* @test
- * @bug 4460583 4470470 4840199 6419424
+ * @bug 4460583 4470470 4840199 6419424 6596323
* @summary Comprehensive test of asynchronous closing and interruption
* @author Mark Reinhold
*/