mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8155965: Unsafe.weakCompareAndSetVolatile entry points and intrinsics
Reviewed-by: psandoz, vlivanov
This commit is contained in:
parent
9773289026
commit
ffc21de072
9 changed files with 60 additions and 0 deletions
|
@ -302,7 +302,19 @@ public class $Qualifier$UnsafeAccessTest$Type$ {
|
|||
$type$ x = UNSAFE.get$Type$(base, offset);
|
||||
assertEquals(x, $value2$, "weakCompareAndSwapRelease $type$");
|
||||
}
|
||||
|
||||
{
|
||||
boolean success = false;
|
||||
for (int c = 0; c < WEAK_ATTEMPTS && !success; c++) {
|
||||
success = UNSAFE.weakCompareAndSwap$Type$Volatile(base, offset, $value2$, $value1$);
|
||||
}
|
||||
assertEquals(success, true, "weakCompareAndSwapVolatile $type$");
|
||||
$type$ x = UNSAFE.get$Type$(base, offset);
|
||||
assertEquals(x, $value1$, "weakCompareAndSwapVolatile $type$");
|
||||
}
|
||||
|
||||
#end[JdkInternalMisc]
|
||||
UNSAFE.put$Type$(base, offset, $value2$);
|
||||
|
||||
// Compare set and get
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue