We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45fb9f9 commit a4becc9Copy full SHA for a4becc9
kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Builders.kt
@@ -91,7 +91,8 @@ private class BlockingCoroutine<T>(
91
init { initParentJob(newContext[Job]) }
92
93
override fun afterCompletion(state: Any?) {
94
- LockSupport.unpark(blockedThread)
+ if (Thread.currentThread() != blockedThread)
95
+ LockSupport.unpark(blockedThread)
96
}
97
98
@Suppress("UNCHECKED_CAST")
kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/EventLoop.kt
@@ -69,7 +69,8 @@ internal class EventLoopImpl(
69
} else
70
queue.addLastIf(node) { parentJob!!.isActive }
71
if (added) {
72
- LockSupport.unpark(thread)
+ if (Thread.currentThread() != thread)
73
+ LockSupport.unpark(thread)
74
} else {
75
node.run()
76
0 commit comments