提交 b180908e 编写于 作者: A alanb

6596323: (fc) ClosedByInterruptException not thrown by the interrupt method (lnx)

Reviewed-by: sherman
上级 b7897ff7
...@@ -43,7 +43,7 @@ class NativeThreadSet { ...@@ -43,7 +43,7 @@ class NativeThreadSet {
// //
int add() { int add() {
long th = NativeThread.current(); long th = NativeThread.current();
if (th <= 0) if (th == -1)
return -1; return -1;
synchronized (this) { synchronized (this) {
int start = 0; int start = 0;
......
...@@ -34,14 +34,14 @@ package sun.nio.ch; ...@@ -34,14 +34,14 @@ package sun.nio.ch;
// upon which Java threads are built, and defines a simple signal mechanism // 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. // 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 // 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 { class NativeThread {
// Returns an opaque token representing the native thread underlying the // Returns an opaque token representing the native thread underlying the
// invoking Java thread. On systems that do not require signalling, this // invoking Java thread. On systems that do not require signalling, this
// method always returns zero. // method always returns -1.
// //
static native long current(); static native long current();
......
...@@ -31,7 +31,7 @@ package sun.nio.ch; ...@@ -31,7 +31,7 @@ package sun.nio.ch;
class NativeThread { class NativeThread {
static long current() { return 0; } static long current() { return -1; }
static void signal(long nt) { } static void signal(long nt) { }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
/* @test /* @test
* @bug 4460583 4470470 4840199 6419424 * @bug 4460583 4470470 4840199 6419424 6596323
* @summary Comprehensive test of asynchronous closing and interruption * @summary Comprehensive test of asynchronous closing and interruption
* @author Mark Reinhold * @author Mark Reinhold
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册