mirror of
https://github.com/apache/activemq-artemis.git
synced 2025-02-13 13:35:47 +00:00
ARTEMIS-908: Replace lock by CAS to avoid deadlock
(cherry picked from commit 4622066323e9ba5af0777d0c7315389ee8f647f5)
This commit is contained in:
parent
be37020964
commit
b0585329b4
@ -637,7 +637,7 @@ public class PagingStoreImpl implements PagingStore {
|
||||
// To be used when the memory is oversized either by local settings or global settings on blocking addresses
|
||||
private static final class OverSizedRunnable implements Runnable {
|
||||
|
||||
private boolean ran;
|
||||
private final AtomicBoolean ran = new AtomicBoolean(false);
|
||||
|
||||
private final Runnable runnable;
|
||||
|
||||
@ -646,11 +646,9 @@ public class PagingStoreImpl implements PagingStore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void run() {
|
||||
if (!ran) {
|
||||
public void run() {
|
||||
if (ran.compareAndSet(false, true)) {
|
||||
runnable.run();
|
||||
|
||||
ran = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user