changeset 359:28522137c831

6596323: (fc) ClosedByInterruptException not thrown by the interrupt method (lnx) Reviewed-by: sherman
author alanb
date Thu, 05 Jun 2008 14:50:28 +0100
parents eac5c4ead3ca
children 8619f18330b5
files src/share/classes/sun/nio/ch/NativeThreadSet.java src/solaris/classes/sun/nio/ch/NativeThread.java src/windows/classes/sun/nio/ch/NativeThread.java test/java/nio/channels/AsyncCloseAndInterrupt.java
diffstat 4 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/nio/ch/NativeThreadSet.java	Thu Jun 05 14:47:03 2008 +0100
+++ b/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/src/solaris/classes/sun/nio/ch/NativeThread.java	Thu Jun 05 14:47:03 2008 +0100
+++ b/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/src/windows/classes/sun/nio/ch/NativeThread.java	Thu Jun 05 14:47:03 2008 +0100
+++ b/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/test/java/nio/channels/AsyncCloseAndInterrupt.java	Thu Jun 05 14:47:03 2008 +0100
+++ b/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
  */