< prev index next >
src/hotspot/share/gc/shared/ptrQueue.cpp
Print this page
@@ -195,11 +195,11 @@
// transfer, false if blocked from doing so by some other thread's
// in-progress transfer.
bool BufferNode::Allocator::try_transfer_pending() {
// Attempt to claim the lock.
if (Atomic::load(&_transfer_lock) || // Skip CAS if likely to fail.
- Atomic::cmpxchg(true, &_transfer_lock, false)) {
+ Atomic::cmpxchg(&_transfer_lock, false, true)) {
return false;
}
// Have the lock; perform the transfer.
// Claim all the pending nodes.
< prev index next >