Skip to content

Commit 0db2492

Browse files
authored
Merge pull request #59 from chacon01/jvm-memory-order
Fix release semantics in jvm_objectmonitor
2 parents 3d95040 + 9992bc2 commit 0db2492

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/jvm/jvm_objectmonitor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*
23+
* Portions copyright (c) 2019, ARM Limited and Contributors. All rights
24+
* reserved.
2325
*/
2426

2527
#ifndef JVM_OBJECT_MONITOR_H
@@ -120,9 +122,7 @@
120122

121123
inline static void release_store_thread(volatile pthread_t* dest,
122124
pthread_t val) {
123-
READ_MEM_BARRIER;
124-
*dest = val;
125-
WRITE_MEM_BARRIER;
125+
__atomic_store_n(dest, val, __ATOMIC_RELEASE);
126126
}
127127

128128
inline static void storeload(void) {

0 commit comments

Comments
 (0)