Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
7df075be
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7df075be
编写于
3月 25, 2016
作者:
S
shade
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8152698: Remove obsolete Unsafe.putOrdered{X} methods, usages, runtime and compiler support
Reviewed-by: kvn, psandoz, dl
上级
d9d15d59
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
40 addition
and
48 deletion
+40
-48
jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java
...share/classes/java/util/concurrent/CompletableFuture.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
...e/classes/java/util/concurrent/ConcurrentLinkedDeque.java
+2
-2
jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java
...e/classes/java/util/concurrent/ConcurrentLinkedQueue.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/Exchanger.java
...va.base/share/classes/java/util/concurrent/Exchanger.java
+3
-3
jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
...base/share/classes/java/util/concurrent/ForkJoinPool.java
+3
-3
jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
...re/classes/java/util/concurrent/ForkJoinWorkerThread.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/FutureTask.java
...a.base/share/classes/java/util/concurrent/FutureTask.java
+3
-3
jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java
...are/classes/java/util/concurrent/SubmissionPublisher.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java
...re/classes/java/util/concurrent/atomic/AtomicBoolean.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java
...re/classes/java/util/concurrent/atomic/AtomicInteger.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
...asses/java/util/concurrent/atomic/AtomicIntegerArray.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
...ava/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
...share/classes/java/util/concurrent/atomic/AtomicLong.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
.../classes/java/util/concurrent/atomic/AtomicLongArray.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
...s/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
.../classes/java/util/concurrent/atomic/AtomicReference.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
...ses/java/util/concurrent/atomic/AtomicReferenceArray.java
+1
-1
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
...a/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
+1
-1
jdk/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java
...base/share/classes/jdk/internal/misc/InnocuousThread.java
+2
-2
jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
...src/java.base/share/classes/jdk/internal/misc/Unsafe.java
+10
-18
jdk/src/java.base/share/classes/sun/misc/Unsafe.java
jdk/src/java.base/share/classes/sun/misc/Unsafe.java
+3
-3
未找到文件。
jdk/src/java.base/share/classes/java/util/concurrent/CompletableFuture.java
浏览文件 @
7df075be
...
...
@@ -480,7 +480,7 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
}
static
void
lazySetNext
(
Completion
c
,
Completion
next
)
{
U
.
putO
rderedObject
(
c
,
NEXT
,
next
);
U
.
putO
bjectRelease
(
c
,
NEXT
,
next
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedDeque.java
浏览文件 @
7df075be
...
...
@@ -309,7 +309,7 @@ public class ConcurrentLinkedDeque<E>
}
void
lazySetNext
(
Node
<
E
>
val
)
{
U
.
putO
rderedObject
(
this
,
NEXT
,
val
);
U
.
putO
bjectRelease
(
this
,
NEXT
,
val
);
}
boolean
casNext
(
Node
<
E
>
cmp
,
Node
<
E
>
val
)
{
...
...
@@ -317,7 +317,7 @@ public class ConcurrentLinkedDeque<E>
}
void
lazySetPrev
(
Node
<
E
>
val
)
{
U
.
putO
rderedObject
(
this
,
PREV
,
val
);
U
.
putO
bjectRelease
(
this
,
PREV
,
val
);
}
boolean
casPrev
(
Node
<
E
>
cmp
,
Node
<
E
>
val
)
{
...
...
jdk/src/java.base/share/classes/java/util/concurrent/ConcurrentLinkedQueue.java
浏览文件 @
7df075be
...
...
@@ -198,7 +198,7 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
}
static
<
E
>
void
lazySetNext
(
Node
<
E
>
node
,
Node
<
E
>
val
)
{
U
.
putO
rderedObject
(
node
,
NEXT
,
val
);
U
.
putO
bjectRelease
(
node
,
NEXT
,
val
);
}
static
<
E
>
boolean
casNext
(
Node
<
E
>
node
,
Node
<
E
>
cmp
,
Node
<
E
>
val
)
{
...
...
jdk/src/java.base/share/classes/java/util/concurrent/Exchanger.java
浏览文件 @
7df075be
...
...
@@ -239,7 +239,7 @@ public class Exchanger<V> {
* not to be as readily inlined by dynamic compilers when they are
* hidden behind other methods that would more nicely name and
* encapsulate the intended effects). This includes the use of
* put
OrderedX
to clear fields of the per-thread Nodes between
* put
XRelease
to clear fields of the per-thread Nodes between
* uses. Note that field Node.item is not declared as volatile
* even though it is read by releasing threads, because they only
* do so after CAS operations that must precede access, and all
...
...
@@ -376,7 +376,7 @@ public class Exchanger<V> {
for
(
int
h
=
p
.
hash
,
spins
=
SPINS
;;)
{
Object
v
=
p
.
match
;
if
(
v
!=
null
)
{
U
.
putO
rderedObject
(
p
,
MATCH
,
null
);
U
.
putO
bjectRelease
(
p
,
MATCH
,
null
);
p
.
item
=
null
;
// clear for next use
p
.
hash
=
h
;
return
v
;
...
...
@@ -507,7 +507,7 @@ public class Exchanger<V> {
break
;
}
}
U
.
putO
rderedObject
(
p
,
MATCH
,
null
);
U
.
putO
bjectRelease
(
p
,
MATCH
,
null
);
p
.
item
=
null
;
p
.
hash
=
h
;
return
v
;
...
...
jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java
浏览文件 @
7df075be
...
...
@@ -289,7 +289,7 @@ public class ForkJoinPool extends AbstractExecutorService {
* on to try or create other queues -- they block only when
* creating and registering new queues. Because it is used only as
* a spinlock, unlocking requires only a "releasing" store (using
* put
OrderedInt
). The qlock is also used during termination
* put
IntRelease
). The qlock is also used during termination
* detection, in which case it is forced to a negative
* non-lockable value.
*
...
...
@@ -1071,7 +1071,7 @@ public class ForkJoinPool extends AbstractExecutorService {
popped
=
true
;
top
=
s
;
}
U
.
put
OrderedInt
(
this
,
QLOCK
,
0
);
U
.
put
IntRelease
(
this
,
QLOCK
,
0
);
}
}
return
popped
;
...
...
@@ -1261,7 +1261,7 @@ public class ForkJoinPool extends AbstractExecutorService {
popped
=
true
;
top
=
s
-
1
;
}
U
.
put
OrderedInt
(
this
,
QLOCK
,
0
);
U
.
put
IntRelease
(
this
,
QLOCK
,
0
);
if
(
popped
)
return
t
;
}
...
...
jdk/src/java.base/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
浏览文件 @
7df075be
...
...
@@ -92,7 +92,7 @@ public class ForkJoinWorkerThread extends Thread {
ForkJoinWorkerThread
(
ForkJoinPool
pool
,
ThreadGroup
threadGroup
,
AccessControlContext
acc
)
{
super
(
threadGroup
,
null
,
"aForkJoinWorkerThread"
);
U
.
putO
rderedObject
(
this
,
INHERITEDACCESSCONTROLCONTEXT
,
acc
);
U
.
putO
bjectRelease
(
this
,
INHERITEDACCESSCONTROLCONTEXT
,
acc
);
eraseThreadLocals
();
// clear before registering
this
.
pool
=
pool
;
this
.
workQueue
=
pool
.
registerWorker
(
this
);
...
...
jdk/src/java.base/share/classes/java/util/concurrent/FutureTask.java
浏览文件 @
7df075be
...
...
@@ -174,7 +174,7 @@ public class FutureTask<V> implements RunnableFuture<V> {
if
(
t
!=
null
)
t
.
interrupt
();
}
finally
{
// final state
U
.
put
OrderedInt
(
this
,
STATE
,
INTERRUPTED
);
U
.
put
IntRelease
(
this
,
STATE
,
INTERRUPTED
);
}
}
}
finally
{
...
...
@@ -230,7 +230,7 @@ public class FutureTask<V> implements RunnableFuture<V> {
protected
void
set
(
V
v
)
{
if
(
U
.
compareAndSwapInt
(
this
,
STATE
,
NEW
,
COMPLETING
))
{
outcome
=
v
;
U
.
put
OrderedInt
(
this
,
STATE
,
NORMAL
);
// final state
U
.
put
IntRelease
(
this
,
STATE
,
NORMAL
);
// final state
finishCompletion
();
}
}
...
...
@@ -248,7 +248,7 @@ public class FutureTask<V> implements RunnableFuture<V> {
protected
void
setException
(
Throwable
t
)
{
if
(
U
.
compareAndSwapInt
(
this
,
STATE
,
NEW
,
COMPLETING
))
{
outcome
=
t
;
U
.
put
OrderedInt
(
this
,
STATE
,
EXCEPTIONAL
);
// final state
U
.
put
IntRelease
(
this
,
STATE
,
EXCEPTIONAL
);
// final state
finishCompletion
();
}
}
...
...
jdk/src/java.base/share/classes/java/util/concurrent/SubmissionPublisher.java
浏览文件 @
7df075be
...
...
@@ -1496,7 +1496,7 @@ public class SubmissionPublisher<T> implements Flow.Publisher<T>,
else
if
(((
c
&
CONSUME
)
!=
0
||
U
.
compareAndSwapInt
(
this
,
CTL
,
c
,
c
|
CONSUME
))
&&
U
.
compareAndSwapObject
(
a
,
i
,
x
,
null
))
{
U
.
put
OrderedInt
(
this
,
HEAD
,
++
h
);
U
.
put
IntRelease
(
this
,
HEAD
,
++
h
);
U
.
getAndAddLong
(
this
,
DEMAND
,
-
1L
);
if
((
w
=
waiter
)
!=
null
)
signalWaiter
(
w
);
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicBoolean.java
浏览文件 @
7df075be
...
...
@@ -136,7 +136,7 @@ public class AtomicBoolean implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
boolean
newValue
)
{
U
.
put
OrderedInt
(
this
,
VALUE
,
(
newValue
?
1
:
0
));
U
.
put
IntRelease
(
this
,
VALUE
,
(
newValue
?
1
:
0
));
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicInteger.java
浏览文件 @
7df075be
...
...
@@ -108,7 +108,7 @@ public class AtomicInteger extends Number implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
int
newValue
)
{
U
.
put
OrderedInt
(
this
,
VALUE
,
newValue
);
U
.
put
IntRelease
(
this
,
VALUE
,
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerArray.java
浏览文件 @
7df075be
...
...
@@ -136,7 +136,7 @@ public class AtomicIntegerArray implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
int
i
,
int
newValue
)
{
U
.
put
OrderedInt
(
array
,
checkedByteOffset
(
i
),
newValue
);
U
.
put
IntRelease
(
array
,
checkedByteOffset
(
i
),
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
浏览文件 @
7df075be
...
...
@@ -475,7 +475,7 @@ public abstract class AtomicIntegerFieldUpdater<T> {
public
final
void
lazySet
(
T
obj
,
int
newValue
)
{
accessCheck
(
obj
);
U
.
put
OrderedInt
(
obj
,
offset
,
newValue
);
U
.
put
IntRelease
(
obj
,
offset
,
newValue
);
}
public
final
int
get
(
T
obj
)
{
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLong.java
浏览文件 @
7df075be
...
...
@@ -124,7 +124,7 @@ public class AtomicLong extends Number implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
long
newValue
)
{
U
.
put
OrderedLong
(
this
,
VALUE
,
newValue
);
U
.
put
LongRelease
(
this
,
VALUE
,
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongArray.java
浏览文件 @
7df075be
...
...
@@ -135,7 +135,7 @@ public class AtomicLongArray implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
int
i
,
long
newValue
)
{
U
.
put
OrderedLong
(
array
,
checkedByteOffset
(
i
),
newValue
);
U
.
put
LongRelease
(
array
,
checkedByteOffset
(
i
),
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
浏览文件 @
7df075be
...
...
@@ -457,7 +457,7 @@ public abstract class AtomicLongFieldUpdater<T> {
public
final
void
lazySet
(
T
obj
,
long
newValue
)
{
accessCheck
(
obj
);
U
.
put
OrderedLong
(
obj
,
offset
,
newValue
);
U
.
put
LongRelease
(
obj
,
offset
,
newValue
);
}
public
final
long
get
(
T
obj
)
{
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java
浏览文件 @
7df075be
...
...
@@ -103,7 +103,7 @@ public class AtomicReference<V> implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
V
newValue
)
{
U
.
putO
rderedObject
(
this
,
VALUE
,
newValue
);
U
.
putO
bjectRelease
(
this
,
VALUE
,
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceArray.java
浏览文件 @
7df075be
...
...
@@ -147,7 +147,7 @@ public class AtomicReferenceArray<E> implements java.io.Serializable {
* @since 1.6
*/
public
final
void
lazySet
(
int
i
,
E
newValue
)
{
U
.
putO
rderedObject
(
array
,
checkedByteOffset
(
i
),
newValue
);
U
.
putO
bjectRelease
(
array
,
checkedByteOffset
(
i
),
newValue
);
}
/**
...
...
jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
浏览文件 @
7df075be
...
...
@@ -426,7 +426,7 @@ public abstract class AtomicReferenceFieldUpdater<T,V> {
public
final
void
lazySet
(
T
obj
,
V
newValue
)
{
accessCheck
(
obj
);
valueCheck
(
newValue
);
U
.
putO
rderedObject
(
obj
,
offset
,
newValue
);
U
.
putO
bjectRelease
(
obj
,
offset
,
newValue
);
}
@SuppressWarnings
(
"unchecked"
)
...
...
jdk/src/java.base/share/classes/jdk/internal/misc/InnocuousThread.java
浏览文件 @
7df075be
...
...
@@ -57,8 +57,8 @@ public final class InnocuousThread extends Thread {
public
InnocuousThread
(
ThreadGroup
group
,
Runnable
target
,
String
name
)
{
super
(
group
,
target
,
name
,
0L
,
false
);
UNSAFE
.
putO
rderedObject
(
this
,
INHERITEDACCESSCONTROLCONTEXT
,
ACC
);
UNSAFE
.
putO
rderedObject
(
this
,
CONTEXTCLASSLOADER
,
ClassLoader
.
getSystemClassLoader
());
UNSAFE
.
putO
bjectRelease
(
this
,
INHERITEDACCESSCONTROLCONTEXT
,
ACC
);
UNSAFE
.
putO
bjectRelease
(
this
,
CONTEXTCLASSLOADER
,
ClassLoader
.
getSystemClassLoader
());
}
@Override
...
...
jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
浏览文件 @
7df075be
...
...
@@ -1457,25 +1457,7 @@ public final class Unsafe {
@HotSpotIntrinsicCandidate
public
native
void
putDoubleVolatile
(
Object
o
,
long
offset
,
double
x
);
/**
* Version of {@link #putObjectVolatile(Object, long, Object)}
* that does not guarantee immediate visibility of the store to
* other threads. This method is generally only useful if the
* underlying field is a Java volatile (or if an array cell, one
* that is otherwise only accessed using volatile accesses).
*
* Corresponds to C11 atomic_store_explicit(..., memory_order_release).
*/
@HotSpotIntrinsicCandidate
public
native
void
putOrderedObject
(
Object
o
,
long
offset
,
Object
x
);
/** Ordered/Lazy version of {@link #putIntVolatile(Object, long, int)} */
@HotSpotIntrinsicCandidate
public
native
void
putOrderedInt
(
Object
o
,
long
offset
,
int
x
);
/** Ordered/Lazy version of {@link #putLongVolatile(Object, long, long)} */
@HotSpotIntrinsicCandidate
public
native
void
putOrderedLong
(
Object
o
,
long
offset
,
long
x
);
/** Acquire version of {@link #getObjectVolatile(Object, long)} */
@HotSpotIntrinsicCandidate
...
...
@@ -1531,6 +1513,16 @@ public final class Unsafe {
return
getDoubleVolatile
(
o
,
offset
);
}
/*
* Versions of {@link #putObjectVolatile(Object, long, Object)}
* that do not guarantee immediate visibility of the store to
* other threads. This method is generally only useful if the
* underlying field is a Java volatile (or if an array cell, one
* that is otherwise only accessed using volatile accesses).
*
* Corresponds to C11 atomic_store_explicit(..., memory_order_release).
*/
/** Release version of {@link #putObjectVolatile(Object, long, Object)} */
@HotSpotIntrinsicCandidate
public
final
void
putObjectRelease
(
Object
o
,
long
offset
,
Object
x
)
{
...
...
jdk/src/java.base/share/classes/sun/misc/Unsafe.java
浏览文件 @
7df075be
...
...
@@ -1068,19 +1068,19 @@ public final class Unsafe {
*/
@ForceInline
public
void
putOrderedObject
(
Object
o
,
long
offset
,
Object
x
)
{
theInternalUnsafe
.
putO
rderedObject
(
o
,
offset
,
x
);
theInternalUnsafe
.
putO
bjectRelease
(
o
,
offset
,
x
);
}
/** Ordered/Lazy version of {@link #putIntVolatile(Object, long, int)} */
@ForceInline
public
void
putOrderedInt
(
Object
o
,
long
offset
,
int
x
)
{
theInternalUnsafe
.
put
OrderedInt
(
o
,
offset
,
x
);
theInternalUnsafe
.
put
IntRelease
(
o
,
offset
,
x
);
}
/** Ordered/Lazy version of {@link #putLongVolatile(Object, long, long)} */
@ForceInline
public
void
putOrderedLong
(
Object
o
,
long
offset
,
long
x
)
{
theInternalUnsafe
.
put
OrderedLong
(
o
,
offset
,
x
);
theInternalUnsafe
.
put
LongRelease
(
o
,
offset
,
x
);
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录