cancelChildren

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

Cancels all children of the Job in this context, without touching the state of this job itself with an optional cancellation cause. See Job.cancel. It does not do anything if there is no job in the context or it has no children.