Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
cc6ed77b
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看板
提交
cc6ed77b
编写于
2月 20, 2012
作者:
A
alanb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6346658: (se) Selector briefly spins when asynchronously closing a registered channel [win]
Reviewed-by: chegar, coffeys
上级
ecb4568e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
21 deletion
+30
-21
src/share/classes/sun/nio/ch/NativeThreadSet.java
src/share/classes/sun/nio/ch/NativeThreadSet.java
+5
-5
src/windows/classes/sun/nio/ch/NativeThread.java
src/windows/classes/sun/nio/ch/NativeThread.java
+5
-1
src/windows/classes/sun/nio/ch/SocketDispatcher.java
src/windows/classes/sun/nio/ch/SocketDispatcher.java
+5
-2
src/windows/native/sun/nio/ch/SocketDispatcher.c
src/windows/native/sun/nio/ch/SocketDispatcher.c
+15
-13
未找到文件。
src/share/classes/sun/nio/ch/NativeThreadSet.java
浏览文件 @
cc6ed77b
...
...
@@ -44,8 +44,9 @@ class NativeThreadSet {
//
int
add
()
{
long
th
=
NativeThread
.
current
();
if
(
th
==
-
1
)
return
-
1
;
// 0 and -1 are treated as placeholders, not real thread handles
if
(
th
==
0
)
th
=
-
1
;
synchronized
(
this
)
{
int
start
=
0
;
if
(
used
>=
elts
.
length
)
{
...
...
@@ -71,8 +72,6 @@ class NativeThreadSet {
// Removes the thread at the given index.
//
void
remove
(
int
i
)
{
if
(
i
<
0
)
return
;
synchronized
(
this
)
{
elts
[
i
]
=
0
;
used
--;
...
...
@@ -91,7 +90,8 @@ class NativeThreadSet {
long
th
=
elts
[
i
];
if
(
th
==
0
)
continue
;
NativeThread
.
signal
(
th
);
if
(
th
!=
-
1
)
NativeThread
.
signal
(
th
);
if
(--
u
==
0
)
break
;
}
...
...
src/windows/classes/sun/nio/ch/NativeThread.java
浏览文件 @
cc6ed77b
...
...
@@ -31,7 +31,11 @@ package sun.nio.ch;
class
NativeThread
{
static
long
current
()
{
return
-
1
;
}
static
long
current
()
{
// return 0 to ensure that async close of blocking sockets will close
// the underlying socket.
return
0
;
}
static
void
signal
(
long
nt
)
{
}
...
...
src/windows/classes/sun/nio/ch/SocketDispatcher.java
浏览文件 @
cc6ed77b
...
...
@@ -55,10 +55,11 @@ class SocketDispatcher extends NativeDispatcher
return
writev0
(
fd
,
address
,
len
);
}
void
close
(
FileDescriptor
fd
)
throws
IOException
{
void
preClose
(
FileDescriptor
fd
)
throws
IOException
{
preClose0
(
fd
);
}
void
preC
lose
(
FileDescriptor
fd
)
throws
IOException
{
void
c
lose
(
FileDescriptor
fd
)
throws
IOException
{
close0
(
fd
);
}
...
...
@@ -75,5 +76,7 @@ class SocketDispatcher extends NativeDispatcher
static
native
long
writev0
(
FileDescriptor
fd
,
long
address
,
int
len
)
throws
IOException
;
static
native
void
preClose0
(
FileDescriptor
fd
)
throws
IOException
;
static
native
void
close0
(
FileDescriptor
fd
)
throws
IOException
;
}
src/windows/native/sun/nio/ch/SocketDispatcher.c
浏览文件 @
cc6ed77b
...
...
@@ -238,23 +238,25 @@ Java_sun_nio_ch_SocketDispatcher_writev0(JNIEnv *env, jclass clazz,
}
JNIEXPORT
void
JNICALL
Java_sun_nio_ch_SocketDispatcher_
c
lose0
(
JNIEnv
*
env
,
jclass
clazz
,
jobject
fdo
)
Java_sun_nio_ch_SocketDispatcher_
preC
lose0
(
JNIEnv
*
env
,
jclass
clazz
,
jobject
fdo
)
{
jint
fd
=
fdval
(
env
,
fdo
);
struct
linger
l
;
int
len
=
sizeof
(
l
);
if
(
fd
!=
-
1
)
{
int
result
=
0
;
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
(
char
*
)
&
l
,
&
len
)
==
0
)
{
if
(
l
.
l_onoff
==
0
)
{
WSASendDisconnect
(
fd
,
NULL
);
}
}
result
=
closesocket
(
fd
);
if
(
result
==
SOCKET_ERROR
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"Socket close failed"
);
if
(
getsockopt
(
fd
,
SOL_SOCKET
,
SO_LINGER
,
(
char
*
)
&
l
,
&
len
)
==
0
)
{
if
(
l
.
l_onoff
==
0
)
{
WSASendDisconnect
(
fd
,
NULL
);
}
}
}
JNIEXPORT
void
JNICALL
Java_sun_nio_ch_SocketDispatcher_close0
(
JNIEnv
*
env
,
jclass
clazz
,
jobject
fdo
)
{
jint
fd
=
fdval
(
env
,
fdo
);
if
(
closesocket
(
fd
)
==
SOCKET_ERROR
)
{
JNU_ThrowIOExceptionWithLastError
(
env
,
"Socket close failed"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录