forked from Qortal/qortal
Prevent potential ConcurrentModificationException in the build queue
This commit is contained in:
parent
06b5b8f793
commit
2637311ef5
@ -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
|
||||
synchronized (buildManager.arbitraryDataBuildQueue) {
|
||||
next = buildManager.arbitraryDataBuildQueue
|
||||
.entrySet().stream()
|
||||
.filter(e -> e.getValue().isQueued())
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (next == null) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user