mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Prevent potential ConcurrentModificationException in the build queue
This commit is contained in:
@@ -36,11 +36,15 @@ public class ArbitraryDataBuilderThread implements Runnable {
|
||||
continue;
|
||||
}
|
||||
|
||||
Map.Entry<String, ArbitraryDataBuildQueueItem> next = null;
|
||||
|
||||
// Find resources that are queued for building
|
||||
Map.Entry<String, ArbitraryDataBuildQueueItem> next = buildManager.arbitraryDataBuildQueue
|
||||
.entrySet().stream()
|
||||
.filter(e -> e.getValue().isQueued())
|
||||
.findFirst().orElse(null);
|
||||
synchronized (buildManager.arbitraryDataBuildQueue) {
|
||||
next = buildManager.arbitraryDataBuildQueue
|
||||
.entrySet().stream()
|
||||
.filter(e -> e.getValue().isQueued())
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (next == null) {
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user