SUGGESTED FIX
$ diff -r cbd182c404d8 src/share/classes/sun/nio/ch/NativeThreadSet.java
--- a/src/share/classes/sun/nio/ch/NativeThreadSet.java Fri May 23 11:13:45 2008 -0700
+++ b/src/share/classes/sun/nio/ch/NativeThreadSet.java Thu May 29 16:13:26 2008 +0100
@@ -43,7 +43,7 @@ class NativeThreadSet {
//
int add() {
long th = NativeThread.current();
- if (th <= 0)
+ if (th == -1)
return -1;
synchronized (this) {
int start = 0;
diff -r cbd182c404d8 src/solaris/classes/sun/nio/ch/NativeThread.java
--- a/src/solaris/classes/sun/nio/ch/NativeThread.java Fri May 23 11:13:45 2008 -0700
+++ b/src/solaris/classes/sun/nio/ch/NativeThread.java Thu May 29 16:13:26 2008 +0100
@@ -41,7 +41,7 @@ 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 return -1.
//
static native long current();
diff -r cbd182c404d8 src/windows/classes/sun/nio/ch/NativeThread.java
--- a/src/windows/classes/sun/nio/ch/NativeThread.java Fri May 23 11:13:45 2008 -0700
+++ b/src/windows/classes/sun/nio/ch/NativeThread.java Thu May 29 16:13:26 2008 +0100
@@ -31,7 +31,7 @@ package sun.nio.ch;
class NativeThread {
- static long current() { return 0; }
+ static long current() { return -1; }
static void signal(long nt) { }
diff -r cbd182c404d8 test/java/nio/channels/AsyncCloseAndInterrupt.java
--- a/test/java/nio/channels/AsyncCloseAndInterrupt.java Fri May 23 11:13:45 2008 -0700
+++ b/test/java/nio/channels/AsyncCloseAndInterrupt.java Thu May 29 16:13:26 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
*/
|