Skip to content

Commit

Permalink
use ConcurrentLinkedQueue instead of non-thread-safe ArrayDeque
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad authored and SirEndii committed Apr 22, 2024
1 parent d7fc90a commit 4acaa1c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

import java.util.ArrayDeque;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;

@Mod.EventBusSubscriber(modid = AdvancedPeripherals.MOD_ID)
public class ServerWorker {

private static final Queue<Runnable> callQueue = new ArrayDeque<>();
private static final Queue<Runnable> callQueue = new ConcurrentLinkedQueue<>();

public static void add(final Runnable call) {
callQueue.add(call);
Expand Down

0 comments on commit 4acaa1c

Please sign in to comment.