mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-16 05:15:22 +00:00
8033545: Missing volatile specifier in Bitmap::par_put_range_within_word
The method Bitmap::par_put_range_within_word reloads the original value during a CAS, which may be optimized away. Instead of reloading, use the value returned by Atomic::cmpxchg_ptr() for further processing. Reviewed-by: tschatzl, brutisso, tonyp
This commit is contained in:
parent
0a63fe1c10
commit
b109e793aa
@ -107,7 +107,7 @@ void BitMap::par_put_range_within_word(idx_t beg, idx_t end, bool value) {
|
||||
while (true) {
|
||||
intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w);
|
||||
if (res == w) break;
|
||||
w = *pw;
|
||||
w = res;
|
||||
nw = value ? (w | ~mr) : (w & mr);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user