Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
f2f6f927
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f2f6f927
编写于
1月 22, 2014
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7133499: (fc) FileChannel.read not preempted by asynchronous close on OS X
Reviewed-by: chegar
上级
6aff2fdc
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
38 addition
and
37 deletion
+38
-37
src/share/classes/sun/nio/ch/FileChannelImpl.java
src/share/classes/sun/nio/ch/FileChannelImpl.java
+1
-1
src/share/classes/sun/nio/ch/NativeThreadSet.java
src/share/classes/sun/nio/ch/NativeThreadSet.java
+11
-11
src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
...classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
+0
-1
src/solaris/native/sun/nio/ch/NativeThread.c
src/solaris/native/sun/nio/ch/NativeThread.c
+26
-19
test/ProblemList.txt
test/ProblemList.txt
+0
-5
未找到文件。
src/share/classes/sun/nio/ch/FileChannelImpl.java
浏览文件 @
f2f6f927
...
...
@@ -110,7 +110,7 @@ public class FileChannelImpl
}
}
nd
.
preClose
(
fd
);
// signal any threads blocked on this channel
threads
.
signalAndWait
();
if
(
parent
!=
null
)
{
...
...
src/share/classes/sun/nio/ch/NativeThreadSet.java
浏览文件 @
f2f6f927
...
...
@@ -82,8 +82,9 @@ class NativeThreadSet {
// Signals all threads in this set.
//
void
signalAndWait
()
{
synchronized
(
this
)
{
synchronized
void
signalAndWait
()
{
boolean
interrupted
=
false
;
while
(
used
>
0
)
{
int
u
=
used
;
int
n
=
elts
.
length
;
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
...
...
@@ -96,16 +97,15 @@ class NativeThreadSet {
break
;
}
waitingToEmpty
=
true
;
boolean
interrupted
=
false
;
while
(
used
>
0
)
{
try
{
wait
(
);
wait
(
50
);
}
catch
(
InterruptedException
e
)
{
interrupted
=
true
;
}
finally
{
waitingToEmpty
=
false
;
}
}
if
(
interrupted
)
Thread
.
currentThread
().
interrupt
();
}
}
}
src/share/classes/sun/nio/ch/SimpleAsynchronousFileChannelImpl.java
浏览文件 @
f2f6f927
...
...
@@ -88,7 +88,6 @@ public class SimpleAsynchronousFileChannelImpl
invalidateAllLocks
();
// signal any threads blocked on this channel
nd
.
preClose
(
fdObj
);
threads
.
signalAndWait
();
// wait until all async I/O operations have completely gracefully
...
...
src/solaris/native/sun/nio/ch/NativeThread.c
浏览文件 @
f2f6f927
...
...
@@ -32,27 +32,32 @@
#include "sun_nio_ch_NativeThread.h"
#include "nio_util.h"
#ifdef __linux__
#include <pthread.h>
#include <sys/signal.h>
/* Also defined in src/solaris/native/java/net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#include <pthread.h>
#include <sys/signal.h>
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#elif __solaris__
#include <thread.h>
#include <signal.h>
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _ALLBSD_SOURCE
#include <pthread.h>
#include <signal.h>
/* Also defined in net/bsd_close.c */
#define INTERRUPT_SIGNAL SIGIO
#else
#error "missing platform-specific definition here"
#endif
static
void
nullHandler
(
int
sig
)
{
}
#endif
JNIEXPORT
void
JNICALL
Java_sun_nio_ch_NativeThread_init
(
JNIEnv
*
env
,
jclass
cl
)
{
#ifdef __linux__
/* Install the null handler for INTERRUPT_SIGNAL. This might overwrite the
* handler previously installed by java/net/linux_close.c, but that's okay
* since neither handler actually does anything. We install our own
...
...
@@ -67,25 +72,27 @@ Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl)
sigemptyset
(
&
sa
.
sa_mask
);
if
(
sigaction
(
INTERRUPT_SIGNAL
,
&
sa
,
&
osa
)
<
0
)
JNU_ThrowIOExceptionWithLastError
(
env
,
"sigaction"
);
#endif
}
JNIEXPORT
jlong
JNICALL
Java_sun_nio_ch_NativeThread_current
(
JNIEnv
*
env
,
jclass
cl
)
{
#ifdef __
linux
__
return
(
long
)
pthread
_self
();
#ifdef __
solaris
__
return
(
jlong
)
thr
_self
();
#else
return
-
1
;
return
(
jlong
)
pthread_self
()
;
#endif
}
JNIEXPORT
void
JNICALL
Java_sun_nio_ch_NativeThread_signal
(
JNIEnv
*
env
,
jclass
cl
,
jlong
thread
)
{
#ifdef __linux__
if
(
pthread_kill
((
pthread_t
)
thread
,
INTERRUPT_SIGNAL
))
JNU_ThrowIOExceptionWithLastError
(
env
,
"Thread signal failed"
);
int
ret
;
#ifdef __solaris__
ret
=
thr_kill
((
thread_t
)
thread
,
INTERRUPT_SIGNAL
);
#else
ret
=
pthread_kill
((
pthread_t
)
thread
,
INTERRUPT_SIGNAL
);
#endif
if
(
ret
!=
0
)
JNU_ThrowIOExceptionWithLastError
(
env
,
"Thread signal failed"
);
}
test/ProblemList.txt
浏览文件 @
f2f6f927
...
...
@@ -183,11 +183,6 @@ java/net/DatagramSocket/SendDatagramToBadAddress.java macosx-all
# 6963118
java/nio/channels/Selector/Wakeup.java windows-all
# 7133499, 7133497
java/nio/channels/AsyncCloseAndInterrupt.java macosx-all
java/nio/channels/AsynchronousFileChannel/Lock.java macosx-all
java/nio/channels/FileChannel/Transfer.java macosx-all
# 7141822
java/nio/channels/DatagramChannel/ChangingAddress.java macosx-all
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录