Skip to content

Commit

Permalink
Backport 18e7d7b5e710b24e49b995777906a197e35795e6
Browse files Browse the repository at this point in the history
  • Loading branch information
neethu-prasad committed Jun 11, 2024
1 parent e716aae commit 282fa69
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahBarrierSetNMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,19 @@
#include "runtime/threadWXSetters.inline.hpp"

bool ShenandoahBarrierSetNMethod::nmethod_entry_barrier(nmethod* nm) {
if (!is_armed(nm)) {
// Some other thread got here first and healed the oops
// and disarmed the nmethod. No need to continue.
return true;
}

ShenandoahReentrantLock* lock = ShenandoahNMethod::lock_for_nmethod(nm);
assert(lock != nullptr, "Must be");
ShenandoahReentrantLocker locker(lock);

if (!is_armed(nm)) {
// Some other thread got here first and healed the oops
// and disarmed the nmethod.
// Some other thread managed to complete while we were
// waiting for lock. No need to continue.
return true;
}

Expand Down

0 comments on commit 282fa69

Please sign in to comment.