diff options
| author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-09-22 11:08:16 +0200 |
|---|---|---|
| committer | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-10-02 12:40:50 +0200 |
| commit | 8de5296b18083361055d11acf6d522c1eef821a4 (patch) | |
| tree | 5e4f4c42bf801f33c40c4efeb5601e0fc4523e36 /core/src/main/kotlin/plugability | |
| parent | 71b03f6d311c6ebfdf67c593e97a7483a64844f4 (diff) | |
| download | dokka-8de5296b18083361055d11acf6d522c1eef821a4.tar.gz dokka-8de5296b18083361055d11acf6d522c1eef821a4.tar.bz2 dokka-8de5296b18083361055d11acf6d522c1eef821a4.zip | |
Make translators run in parallel.
Diffstat (limited to 'core/src/main/kotlin/plugability')
| -rw-r--r-- | core/src/main/kotlin/plugability/LazyEvaluated.kt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/src/main/kotlin/plugability/LazyEvaluated.kt b/core/src/main/kotlin/plugability/LazyEvaluated.kt index c0c271f4..17fad525 100644 --- a/core/src/main/kotlin/plugability/LazyEvaluated.kt +++ b/core/src/main/kotlin/plugability/LazyEvaluated.kt @@ -2,6 +2,7 @@ package org.jetbrains.dokka.plugability internal class LazyEvaluated<T : Any> private constructor(private val recipe: ((DokkaContext) -> T)? = null, private var value: T? = null) { + @Synchronized internal fun get(context: DokkaContext): T { if(value == null) { value = recipe?.invoke(context) @@ -13,4 +14,4 @@ internal class LazyEvaluated<T : Any> private constructor(private val recipe: (( fun <T : Any> fromInstance(value: T) = LazyEvaluated(value = value) fun <T : Any> fromRecipe(recipe: (DokkaContext) -> T) = LazyEvaluated(recipe = recipe) } -}
\ No newline at end of file +} |
