8194406: Use Atomic::replace_if_null

Reviewed-by: coleenp, dholmes
This commit is contained in:
Kim Barrett 2018-01-04 18:18:18 -05:00
parent c7e601e911
commit 9e5bf18428
9 changed files with 17 additions and 18 deletions

View file

@ -1625,7 +1625,7 @@ bool nmethod::test_set_oops_do_mark() {
assert(nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
if (_oops_do_mark_link == NULL) {
// Claim this nmethod for this thread to mark.
if (Atomic::cmpxchg(NMETHOD_SENTINEL, &_oops_do_mark_link, (nmethod*)NULL) == NULL) {
if (Atomic::replace_if_null(NMETHOD_SENTINEL, &_oops_do_mark_link)) {
// Atomically append this nmethod (now claimed) to the head of the list:
nmethod* observed_mark_nmethods = _oops_do_mark_nmethods;
for (;;) {