commit | 58a7add417403811e822a4f6f7689ae3fd0e2018 | [log] [tgz] |
---|---|---|
author | Roman Elizarov <elizarov@gmail.com> | Fri Jan 20 12:19:52 2017 +0300 |
committer | Roman Elizarov <elizarov@gmail.com> | Tue Jan 24 12:03:55 2017 +0300 |
tree | c626bc6a50aaeb844f4c768463fc5d09424cab67 | |
parent | 53a0a4048a4cfb8ebc7329a9ee3af61c402b6c9d [diff] [blame] |
Fixed initialization of Job with parent (initParentJob), fixed handling on uncaught exceptions in standalone coroutines
diff --git a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Deferred.kt b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Deferred.kt index 7d24d2d..59f36cc 100644 --- a/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Deferred.kt +++ b/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Deferred.kt
@@ -39,6 +39,8 @@ private class DeferredCoroutine<T>( parentContext: CoroutineContext ) : AbstractCoroutine<T>(parentContext), Deferred<T> { + init { initParentJob(parentContext[Job]) } + @Suppress("UNCHECKED_CAST") suspend override fun await(): T { // quick check if already complete (avoid extra object creation)