ARTEMIS-4569 Improving order in which the list is added versus cancel call
I just did some static analysis of this code, and I believe it would be better to first add to the list before setting the cancel task. Reason for that is in case the Runnable is dequeued between the add in the deQueue and setting the cancel task. Possibility is remote but my OCD wouldn't let me ignore this small possibility.
This commit is contained in:
parent
22a31fb254
commit
2760a3e911
|
@ -1035,8 +1035,8 @@ public class PagingStoreImpl implements PagingStore {
|
|||
}
|
||||
|
||||
private void addToBlockList(AtomicRunnable atomicRunnable, Consumer<AtomicRunnable> accepted) {
|
||||
onMemoryFreedRunnables.add(atomicRunnable);
|
||||
atomicRunnable.setCancel(onMemoryFreedRunnables::remove);
|
||||
onMemoryFreedRunnables.add(atomicRunnable);
|
||||
if (accepted != null) {
|
||||
accepted.accept(atomicRunnable);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue