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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map.Entry<String, ArbitraryDataBuildQueueItem> next = null;
|
||||||
|
|
||||||
// Find resources that are queued for building
|
// Find resources that are queued for building
|
||||||
Map.Entry<String, ArbitraryDataBuildQueueItem> next = buildManager.arbitraryDataBuildQueue
|
synchronized (buildManager.arbitraryDataBuildQueue) {
|
||||||
|
next = buildManager.arbitraryDataBuildQueue
|
||||||
.entrySet().stream()
|
.entrySet().stream()
|
||||||
.filter(e -> e.getValue().isQueued())
|
.filter(e -> e.getValue().isQueued())
|
||||||
.findFirst().orElse(null);
|
.findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (next == null) {
|
if (next == null) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user