Fix yet another issue with concurrency with datafixers

This commit is contained in:
Aikar 2018-09-04 01:50:14 -04:00
parent 39042c4a36
commit 2e8340addd
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE
2 changed files with 36 additions and 10 deletions

View File

@ -1,4 +1,4 @@
From 361c1cfba32b0bad5325c9f91c468fcca3cba5b5 Mon Sep 17 00:00:00 2001
From c4c58dc229e97fd54d277807534346fc186df004 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 3 Sep 2018 22:18:38 -0400
Subject: [PATCH] Fix concurrency issues in DataFixers
@ -44,6 +44,19 @@ index fb2c380f8a..c8e7a8aa10 100644
return rules.get(key);
}
diff --git a/src/main/java/com/mojang/datafixers/functions/PointFree.java b/src/main/java/com/mojang/datafixers/functions/PointFree.java
index 0d88490f77..028942b8ea 100644
--- a/src/main/java/com/mojang/datafixers/functions/PointFree.java
+++ b/src/main/java/com/mojang/datafixers/functions/PointFree.java
@@ -14,7 +14,7 @@ public abstract class PointFree<T> {
private Function<DynamicOps<?>, T> value;
@SuppressWarnings("ConstantConditions")
- public Function<DynamicOps<?>, T> evalCached() {
+ public synchronized Function<DynamicOps<?>, T> evalCached() { // Paper
if (!initialized) {
initialized = true;
value = eval();
diff --git a/src/main/java/com/mojang/datafixers/schemas/Schema.java b/src/main/java/com/mojang/datafixers/schemas/Schema.java
index 7c67d989e0..45f3ef5957 100644
--- a/src/main/java/com/mojang/datafixers/schemas/Schema.java

View File

@ -83,23 +83,36 @@ for f in $files; do
fi
done
# Import Libraries - these must always be mapped manually, no automatic stuff
# group lib prefix files
importLibrary com.mojang datafixerupper com/mojang/datafixers \
schemas/Schema.java \
DataFixerUpper.java \
types/families/RecursiveTypeFamily.java
########################################################
########################################################
########################################################
# NMS IMPORTS
# Temporarily add new NMS dev imports here before you run paper patch
# but after you have paper rb'd your changes, remove the line from this file before committing.
# we do not need any lines added to this file
# we do not need any lines added to this file for NMS
# import FileName
########################################################
########################################################
########################################################
# LIBRARY IMPORTS
# These must always be mapped manually, no automatic stuff
#
# # group # lib # prefix # many files
importLibrary com.mojang datafixerupper com/mojang/datafixers \
schemas/Schema.java \
DataFixerUpper.java \
functions/PointFree.java \
types/families/RecursiveTypeFamily.java
# dont forget \ at end of each line but last
########################################################
########################################################
########################################################
set -e
cd "$workdir/Spigot/Spigot-Server/"
rm -rf nms-patches applyPatches.sh makePatches.sh >/dev/null 2>&1