Skip to content

Commit 7a4a090

Browse files
committed
chore: replace drain with poll for queue for GameThread
1 parent cfcc712 commit 7a4a090

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

engine/src/main/java/org/terasology/engine/core/GameThread.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ public static void synch(Runnable process) throws InterruptedException {
7070
*/
7171
public static void processWaitingProcesses() {
7272
if (Thread.currentThread() == gameThread) {
73-
List<Runnable> processes = Lists.newArrayList();
74-
pendingRunnables.drainTo(processes);
75-
processes.forEach(Runnable::run);
73+
Runnable inst;
74+
while((inst =pendingRunnables.poll()) != null) {
75+
inst.run();
76+
}
7677
}
7778
}
7879

0 commit comments

Comments
 (0)