Update locks - resolves GH-25

This commit is contained in:
Sotr
2018-07-14 03:05:59 +08:00
parent ca8e0d7c0f
commit 3875266bb7
5 changed files with 16 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
package net.minecraft.server;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.googlecode.concurentlocks.ReentrantReadWriteUpdateLock;
import io.akarin.api.internal.collections.CheckedConcurrentLinkedQueue;
import io.akarin.api.internal.utils.CheckedConcurrentLinkedQueue;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
@@ -75,7 +76,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
};
private final EnumProtocolDirection h;
private final Queue<NetworkManager.QueuedPacket> i = new CheckedConcurrentLinkedQueue<NetworkManager.QueuedPacket>(); private final Queue<NetworkManager.QueuedPacket> getPacketQueue() { return this.i; } // Paper - Anti-Xray - OBFHELPER // Akarin
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
private final ReentrantReadWriteUpdateLock j = new ReentrantReadWriteUpdateLock(); // Akarin - use update lock
public Channel channel;
// Spigot Start // PAIL
public SocketAddress l;