geforkt von Mirrors/Paper
61c0f2d99e
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:eb2e6578
SPIGOT-5116: Fix concurrent modification exception inside ChunkMapDistance989f9b3d
SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate eventsf554183c
SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving2349feb8
SPIGOT-5163: Cancelling PlayerBucketFillEvent visually removes the targeted block Spigot Changes: 9a643a6a Remove DataWatcher Locking
49 Zeilen
3.0 KiB
Diff
49 Zeilen
3.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Fri, 21 Jun 2019 14:42:48 -0700
|
|
Subject: [PATCH] Log other thread in DataPaletteBlock lock failure
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/util/ReentrantLockWithGetOwner.java b/src/main/java/com/destroystokyo/paper/util/ReentrantLockWithGetOwner.java
|
|
new file mode 100644
|
|
index 000000000..a3b174618
|
|
--- /dev/null
|
|
+++ b/src/main/java/com/destroystokyo/paper/util/ReentrantLockWithGetOwner.java
|
|
@@ -0,0 +0,0 @@
|
|
+package com.destroystokyo.paper.util;
|
|
+
|
|
+import java.util.concurrent.locks.ReentrantLock;
|
|
+
|
|
+public class ReentrantLockWithGetOwner extends ReentrantLock {
|
|
+
|
|
+ @Override
|
|
+ public Thread getOwner() {
|
|
+ return super.getOwner();
|
|
+ }
|
|
+}
|
|
diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
|
index 28a6be7ab..e05b9d606 100644
|
|
--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
|
+++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java
|
|
@@ -0,0 +0,0 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> {
|
|
protected DataBits a; protected DataBits getDataBits() { return this.a; } // Paper - OBFHELPER
|
|
private DataPalette<T> h; private DataPalette<T> getDataPalette() { return this.h; } // Paper - OBFHELPER
|
|
private int i; private int getBitsPerObject() { return this.i; } // Paper - OBFHELPER
|
|
- private final ReentrantLock j = new ReentrantLock();
|
|
+ private final com.destroystokyo.paper.util.ReentrantLockWithGetOwner j = new com.destroystokyo.paper.util.ReentrantLockWithGetOwner(); private com.destroystokyo.paper.util.ReentrantLockWithGetOwner getLock() { return this.j; } // Paper - change type to ReentrantLockWithGetOwner // Paper - OBFHELPER
|
|
|
|
public void a() {
|
|
- if (this.j.isLocked() && !this.j.isHeldByCurrentThread()) {
|
|
+ // Paper start - log other thread
|
|
+ Thread owningThread;
|
|
+ if (this.j.isLocked() && (owningThread = this.getLock().getOwner()) != null && owningThread != Thread.currentThread()) {
|
|
+ // Paper end
|
|
String s = (String) Thread.getAllStackTraces().keySet().stream().filter(Objects::nonNull).map((thread) -> {
|
|
return thread.getName() + ": \n\tat " + (String) Arrays.stream(thread.getStackTrace()).map(Object::toString).collect(Collectors.joining("\n\tat "));
|
|
}).collect(Collectors.joining("\n"));
|
|
- CrashReport crashreport = new CrashReport("Writing into PalettedContainer from multiple threads", new IllegalStateException());
|
|
+ CrashReport crashreport = new CrashReport("Writing into PalettedContainer from multiple threads (other thread: name: " + owningThread.getName() + ", class: " + owningThread.getClass().toString() + ")", new IllegalStateException()); // Paper - log other thread
|
|
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Thread dumps");
|
|
|
|
crashreportsystemdetails.a("Thread dumps", (Object) s);
|
|
--
|