Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2c8e932e
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看板
提交
2c8e932e
编写于
4月 18, 2011
作者:
D
dl
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7037436: CR 7035020 fails to check shutdown
Reviewed-by: chegar
上级
59d00fca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
13 deletion
+14
-13
src/share/classes/java/util/concurrent/ForkJoinPool.java
src/share/classes/java/util/concurrent/ForkJoinPool.java
+11
-10
src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
...re/classes/java/util/concurrent/ForkJoinWorkerThread.java
+3
-3
未找到文件。
src/share/classes/java/util/concurrent/ForkJoinPool.java
浏览文件 @
2c8e932e
...
...
@@ -824,7 +824,8 @@ public class ForkJoinPool extends AbstractExecutorService {
else
if
(
w
.
eventCount
!=
v
)
return
true
;
// update next time
}
if
((
int
)
c
!=
0
&&
parallelism
+
(
int
)(
nc
>>
AC_SHIFT
)
==
0
&&
if
((!
shutdown
||
!
tryTerminate
(
false
))
&&
(
int
)
c
!=
0
&&
parallelism
+
(
int
)(
nc
>>
AC_SHIFT
)
==
0
&&
blockedCount
==
0
&&
quiescerCount
==
0
)
idleAwaitWork
(
w
,
nc
,
c
,
v
);
// quiescent
for
(
boolean
rescanned
=
false
;;)
{
...
...
@@ -1024,8 +1025,8 @@ public class ForkJoinPool extends AbstractExecutorService {
do
{}
while
(!
UNSAFE
.
compareAndSwapLong
(
this
,
ctlOffset
,
// no mask
c
=
ctl
,
c
+
AC_UNIT
));
int
b
;
do
{}
while
(!
UNSAFE
.
compareAndSwapInt
(
this
,
blockedCountOffset
,
b
=
blockedCount
,
b
-
1
));
do
{}
while
(!
UNSAFE
.
compareAndSwapInt
(
this
,
blockedCountOffset
,
b
=
blockedCount
,
b
-
1
));
}
/**
...
...
@@ -1177,7 +1178,7 @@ public class ForkJoinPool extends AbstractExecutorService {
ws
[
k
]
=
w
;
nextWorkerIndex
=
k
+
1
;
int
m
=
g
&
SMASK
;
g
=
k
>
m
?
((
m
<<
1
)
+
1
)
&
SMASK
:
g
+
(
SG_UNIT
<<
1
);
g
=
(
k
>
m
)
?
((
m
<<
1
)
+
1
)
&
SMASK
:
g
+
(
SG_UNIT
<<
1
);
}
}
finally
{
scanGuard
=
g
;
...
...
@@ -1360,8 +1361,8 @@ public class ForkJoinPool extends AbstractExecutorService {
*/
final
void
addQuiescerCount
(
int
delta
)
{
int
c
;
do
{}
while
(!
UNSAFE
.
compareAndSwapInt
(
this
,
quiescerCountOffset
,
c
=
quiescerCount
,
c
+
delta
));
do
{}
while
(!
UNSAFE
.
compareAndSwapInt
(
this
,
quiescerCountOffset
,
c
=
quiescerCount
,
c
+
delta
));
}
/**
...
...
@@ -1714,7 +1715,7 @@ public class ForkJoinPool extends AbstractExecutorService {
*/
public
int
getRunningThreadCount
()
{
int
r
=
parallelism
+
(
int
)(
ctl
>>
AC_SHIFT
);
return
r
<=
0
?
0
:
r
;
// suppress momentarily negative values
return
(
r
<=
0
)
?
0
:
r
;
// suppress momentarily negative values
}
/**
...
...
@@ -1726,7 +1727,7 @@ public class ForkJoinPool extends AbstractExecutorService {
*/
public
int
getActiveThreadCount
()
{
int
r
=
parallelism
+
(
int
)(
ctl
>>
AC_SHIFT
)
+
blockedCount
;
return
r
<=
0
?
0
:
r
;
// suppress momentarily negative values
return
(
r
<=
0
)
?
0
:
r
;
// suppress momentarily negative values
}
/**
...
...
@@ -1881,9 +1882,9 @@ public class ForkJoinPool extends AbstractExecutorService {
int
ac
=
rc
+
blockedCount
;
String
level
;
if
((
c
&
STOP_BIT
)
!=
0
)
level
=
(
tc
==
0
)?
"Terminated"
:
"Terminating"
;
level
=
(
tc
==
0
)
?
"Terminated"
:
"Terminating"
;
else
level
=
shutdown
?
"Shutting down"
:
"Running"
;
level
=
shutdown
?
"Shutting down"
:
"Running"
;
return
super
.
toString
()
+
"["
+
level
+
", parallelism = "
+
pc
+
...
...
src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
浏览文件 @
2c8e932e
...
...
@@ -361,7 +361,7 @@ public class ForkJoinWorkerThread extends Thread {
protected
void
onStart
()
{
queue
=
new
ForkJoinTask
<?>[
INITIAL_QUEUE_CAPACITY
];
int
r
=
pool
.
workerSeedGenerator
.
nextInt
();
seed
=
(
r
==
0
)?
1
:
r
;
// must be nonzero
seed
=
(
r
==
0
)
?
1
:
r
;
// must be nonzero
}
/**
...
...
@@ -724,7 +724,7 @@ public class ForkJoinWorkerThread extends Thread {
Thread
.
yield
();
// for politeness
}
else
retries
=
helpJoinTask
(
joinMe
)?
MAX_HELP
:
retries
-
1
;
retries
=
helpJoinTask
(
joinMe
)
?
MAX_HELP
:
retries
-
1
;
}
else
{
retries
=
MAX_HELP
;
// restart if not done
...
...
@@ -955,7 +955,7 @@ public class ForkJoinWorkerThread extends Thread {
p
.
addActiveCount
(
1
);
}
if
((
t
=
(
v
!=
this
)
?
v
.
deqTask
()
:
locallyFifo
?
locallyDeqTask
()
:
popTask
())
!=
null
)
{
locallyFifo
?
locallyDeqTask
()
:
popTask
())
!=
null
)
{
currentSteal
=
t
;
t
.
doExec
();
currentSteal
=
ps
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录