Skip to content

Commit 7400ff0

Browse files
committed
EventLoop works until the job isCompleted (process while cancelling)
1 parent 769d482 commit 7400ff0

File tree

1 file changed

+1
-1
lines changed
  • kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/Builders.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private class BlockingCoroutine<T>(
223223
if (Thread.interrupted()) throw InterruptedException().also { cancel(it) }
224224
val parkNanos = eventLoop?.processNextEvent() ?: Long.MAX_VALUE
225225
// note: process next even may look unpark flag, so check !isActive before parking
226-
if (!isActive) break
226+
if (isCompleted) break
227227
LockSupport.parkNanos(this, parkNanos)
228228
}
229229
// process queued events (that could have been added after last processNextEvent and before cancel

0 commit comments

Comments
 (0)