aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-04-15 21:14:26 +0200
committerGuillaume Martres <smarter@ubuntu.com>2017-04-15 21:14:26 +0200
commit934ab5b341a4c2548041138893d8a0dd4c8d4aa6 (patch)
treed1c55176a276379b758026099ee52c08b65e22b2
parentd773a32c9731dd5b105ac718900f8217fa75bcb2 (diff)
downloaddotty-934ab5b341a4c2548041138893d8a0dd4c8d4aa6.zip
dotty-934ab5b341a4c2548041138893d8a0dd4c8d4aa6.tar.gz
dotty-934ab5b341a4c2548041138893d8a0dd4c8d4aa6.tar.bz2
Make CompilerClassLoader#fixBridgeLoader synchronized
This method could be called from multiple threads since sbt could run multiple `compile` task in parallel.
-rw-r--r--sbt-bridge/src/xsbt/CompilerClassLoader.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbt-bridge/src/xsbt/CompilerClassLoader.scala b/sbt-bridge/src/xsbt/CompilerClassLoader.scala
index c0bdcb5..071141d 100644
--- a/sbt-bridge/src/xsbt/CompilerClassLoader.scala
+++ b/sbt-bridge/src/xsbt/CompilerClassLoader.scala
@@ -80,8 +80,9 @@ object CompilerClassLoader {
* @param bridgeLoader The classloader that sbt uses to load the compiler bridge
* @return A fixed classloader that works with dotty
*/
- def fixBridgeLoader(bridgeLoader: ClassLoader): ClassLoader =
+ def fixBridgeLoader(bridgeLoader: ClassLoader): ClassLoader = synchronized {
fixedLoaderCache.getOrElseUpdate(bridgeLoader, computeFixedLoader(bridgeLoader))
+ }
private[this] def computeFixedLoader(bridgeLoader: ClassLoader) = bridgeLoader match {
case bridgeLoader: URLClassLoader =>