diff options
author | Jonas Herzig <jonas@spark-squared.com> | 2020-05-22 11:42:39 +0200 |
---|---|---|
committer | Jonas Herzig <jonas@spark-squared.com> | 2020-05-22 11:42:39 +0200 |
commit | c0cdf855f33ad27f9ea6741781a52ab37afce6be (patch) | |
tree | 0d9d7dbb9e750d318e9a4edddb9232dbc60133f0 | |
parent | 19874df1e75436b58d06f423f5959dbe3619aa58 (diff) | |
download | Remap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.tar.gz Remap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.tar.bz2 Remap-c0cdf855f33ad27f9ea6741781a52ab37afce6be.zip |
Fix thread-unsafe extension point registering
-rw-r--r-- | src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt | 6 |
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 |