1 /*
2  * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3  */
4 
5 package kotlinx.coroutines
6 
7 import kotlin.coroutines.*
8 
9 /**
10  * A coroutine dispatcher that is not confined to any specific thread.
11  */
12 internal object Unconfined : CoroutineDispatcher() {
13     override fun isDispatchNeeded(context: CoroutineContext): Boolean = false
14     override fun dispatch(context: CoroutineContext, block: Runnable) { throw UnsupportedOperationException() }
15     override fun toString(): String = "Unconfined"
16 }
17