Remove monitored locks (fair), use basic version
This commit is contained in:
@@ -45,8 +45,6 @@ import net.packet.Packet;
|
||||
import net.server.PlayerBuffValueHolder;
|
||||
import net.server.PlayerCoolDownValueHolder;
|
||||
import net.server.Server;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import net.server.coordinator.world.InviteCoordinator;
|
||||
import net.server.guild.Alliance;
|
||||
import net.server.guild.Guild;
|
||||
@@ -217,9 +215,9 @@ public class Character extends AbstractCharacterObject {
|
||||
private ScheduledFuture<?> chairRecoveryTask = null;
|
||||
private ScheduledFuture<?> pendantOfSpirit = null; //1122017
|
||||
private ScheduledFuture<?> cpqSchedule = null;
|
||||
private final Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
||||
private final Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
||||
private final Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true);
|
||||
private final Lock chrLock = new ReentrantLock(true);
|
||||
private final Lock evtLock = new ReentrantLock(true);
|
||||
private final Lock petLock = new ReentrantLock(true);
|
||||
private final Lock prtLock = new ReentrantLock();
|
||||
private final Lock cpnLock = new ReentrantLock();
|
||||
private final Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
|
||||
|
||||
@@ -36,8 +36,6 @@ import net.packet.Packet;
|
||||
import net.packet.logging.LoggingUtil;
|
||||
import net.packet.logging.MonitoredChrLogger;
|
||||
import net.server.Server;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.coordinator.login.LoginBypassCoordinator;
|
||||
import net.server.coordinator.session.Hwid;
|
||||
@@ -81,6 +79,7 @@ import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@@ -122,9 +121,9 @@ public class Client extends ChannelInboundHandlerAdapter {
|
||||
private byte gender = -1;
|
||||
private boolean disconnecting = false;
|
||||
private final Semaphore actionsSemaphore = new Semaphore(7);
|
||||
private final Lock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT, true);
|
||||
private final Lock encoderLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT_ENCODER, true);
|
||||
private final Lock announcerLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CLIENT_ANNOUNCER, true);
|
||||
private final Lock lock = new ReentrantLock(true);
|
||||
private final Lock encoderLock = new ReentrantLock(true);
|
||||
private final Lock announcerLock = new ReentrantLock(true);
|
||||
// thanks Masterrulax & try2hack for pointing out a bottleneck issue with shared locks, shavit for noticing an opportunity for improvement
|
||||
private Calendar tempBanCalendar;
|
||||
private int votePoints;
|
||||
|
||||
@@ -25,8 +25,6 @@ import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.ItemInformationProvider;
|
||||
@@ -36,6 +34,7 @@ import tools.Pair;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* @author Matze, Ronan
|
||||
@@ -44,7 +43,7 @@ public class Inventory implements Iterable<Item> {
|
||||
private static final Logger log = LoggerFactory.getLogger(Inventory.class);
|
||||
protected final Map<Short, Item> inventory;
|
||||
protected final InventoryType type;
|
||||
protected final Lock lock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.INVENTORY, true);
|
||||
protected final Lock lock = new ReentrantLock(true);
|
||||
|
||||
protected Character owner;
|
||||
protected byte slotLimit;
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
*/
|
||||
package client.inventory;
|
||||
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.Pair;
|
||||
|
||||
@@ -29,6 +27,7 @@ import java.sql.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* @author Flav
|
||||
@@ -52,7 +51,7 @@ public enum ItemFactory {
|
||||
|
||||
static {
|
||||
for (int i = 0; i < lockCount; i++) {
|
||||
locks[i] = MonitoredReentrantLockFactory.createLock(MonitoredLockType.ITEM, true);
|
||||
locks[i] = new ReentrantLock(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user