mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Wait monitoring should always be enabled
This commit is contained in:
parent
224a1f57b4
commit
72002a3d75
@ -136,7 +136,6 @@ public final class MinecraftServer {
|
||||
private static int compressionThreshold = 256;
|
||||
private static boolean packetCaching = true;
|
||||
private static boolean groupedPacket = true;
|
||||
private static boolean waitMonitoring = true;
|
||||
private static ResponseDataConsumer responseDataConsumer;
|
||||
private static String brandName = "Minestom";
|
||||
private static Difficulty difficulty = Difficulty.NORMAL;
|
||||
@ -614,14 +613,6 @@ public final class MinecraftServer {
|
||||
MinecraftServer.groupedPacket = groupedPacket;
|
||||
}
|
||||
|
||||
public static boolean hasWaitMonitoring() {
|
||||
return waitMonitoring;
|
||||
}
|
||||
|
||||
public static void setWaitMonitoring(boolean waitMonitoring) {
|
||||
MinecraftServer.waitMonitoring = waitMonitoring;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the consumer executed to show server-list data.
|
||||
*
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.minestom.server.lock;
|
||||
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.thread.BatchThread;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@ -90,11 +89,7 @@ public final class Acquisition {
|
||||
|
||||
protected static ReentrantLock acquireEnter(Thread currentThread, BatchThread elementThread) {
|
||||
// Monitoring
|
||||
final boolean monitoring = MinecraftServer.hasWaitMonitoring();
|
||||
long time = 0;
|
||||
if (monitoring) {
|
||||
time = System.nanoTime();
|
||||
}
|
||||
long time = System.nanoTime();
|
||||
|
||||
ReentrantLock currentLock;
|
||||
{
|
||||
@ -118,10 +113,7 @@ public final class Acquisition {
|
||||
}
|
||||
|
||||
// Monitoring
|
||||
if (monitoring) {
|
||||
time = System.nanoTime() - time;
|
||||
WAIT_COUNTER_NANO.addAndGet(time);
|
||||
}
|
||||
WAIT_COUNTER_NANO.addAndGet(System.nanoTime() - time);
|
||||
|
||||
return !acquired ? lock : null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user