cancelChildren

fun CoroutineContext.cancelChildren(
    cause: Throwable? = null
): Unit
(source)

Cancels all children of the Job in this context with an optional cancellation cause. It does not do anything if there is no job in the context or it has no children. See Job.cancelChildren for details.