aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/replaymod
diff options
context:
space:
mode:
authorJonas Herzig <jonas@spark-squared.com>2020-05-22 11:42:39 +0200
committerJonas Herzig <jonas@spark-squared.com>2020-05-22 11:42:39 +0200
commitc0cdf855f33ad27f9ea6741781a52ab37afce6be (patch)
tree0d9d7dbb9e750d318e9a4edddb9232dbc60133f0 /src/main/kotlin/com/replaymod
parent19874df1e75436b58d06f423f5959dbe3619aa58 (diff)
downloadRemap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.tar.gz
Remap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.tar.bz2
Remap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.zip
Fix thread-unsafe extension point registering
Diffstat (limited to 'src/main/kotlin/com/replaymod')
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
index 8df1f68..3849483 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
@@ -64,8 +64,10 @@ class Transformer(private val map: MappingSet) {
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
val rootArea = Extensions.getRootArea()
- if (!rootArea.hasExtensionPoint(CustomExceptionHandler.KEY)) {
- rootArea.registerExtensionPoint(CustomExceptionHandler.KEY.name, CustomExceptionHandler::class.java.name, ExtensionPoint.Kind.INTERFACE)
+ synchronized(rootArea) {
+ if (!rootArea.hasExtensionPoint(CustomExceptionHandler.KEY)) {
+ rootArea.registerExtensionPoint(CustomExceptionHandler.KEY.name, CustomExceptionHandler::class.java.name, ExtensionPoint.Kind.INTERFACE)
+ }
}
val project = environment.project as MockProject