Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,14 @@ public final void lock() {
this.locked = true;
this.dump();

// Run all of the on lock runnables and then clear them.
this.onLockRunnables.forEach(Runnable::run);
this.onLockRunnables.clear();
if (onLockRunnables.isEmpty()) {
return;
}

// Copy the onLockRunnables to prevent a ConcurrentModificationException
List<Runnable> current = new ArrayList<>(onLockRunnables);
onLockRunnables.clear();
current.forEach(Runnable::run);
}

/**
Expand Down