Skip to content

Commit 703b99a

Browse files
committed
~ Use CoroutineContext.cancel extension
1 parent 49f522e commit 703b99a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kotlinx-coroutines-core/jvm/src/Executors.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ internal abstract class ExecutorCoroutineDispatcherBase : ExecutorCoroutineDispa
139139
}
140140

141141
private fun cancelJobOnRejection(context: CoroutineContext, exception: RejectedExecutionException) {
142-
context[Job]?.cancel(CancellationException("The task was rejected", exception))
142+
context.cancel(CancellationException("The task was rejected", exception))
143143
}
144144

145145
override fun close() {

0 commit comments

Comments
 (0)