newCoroutineContext

@JvmOverloads fun newCoroutineContext(
    context: CoroutineContext,
    parent: Job? = null
): CoroutineContext

Creates context for the new coroutine. It installs DefaultDispatcher when no other dispatcher nor ContinuationInterceptor is specified, and adds optional support for debugging facilities (when turned on).

Debugging facilities: In debug mode every coroutine is assigned a unique consecutive identifier. Every thread that executes a coroutine has its name modified to include the name and identifier of the currently currently running coroutine. When one coroutine is suspended and resumes another coroutine that is dispatched in the same thread, then the thread name displays the whole stack of coroutine descriptions that are being executed on this thread.

Enable debugging facilities with “kotlinx.coroutines.debug” (DEBUG_PROPERTY_NAME) system property , use the following values:

Coroutine name can be explicitly assigned using CoroutineName context element. The string “coroutine” is used as a default name.