@@ -37,11 +37,11 @@ private object UnlimitedIoScheduler : CoroutineDispatcher() {
37
37
38
38
@InternalCoroutinesApi
39
39
override fun dispatchYield (context : CoroutineContext , block : Runnable ) {
40
- DefaultScheduler .dispatchWithContext(block, BlockingContext , true )
40
+ DefaultScheduler .dispatchWithContext(block, BlockingContext , fair = true , track = true )
41
41
}
42
42
43
43
override fun dispatch (context : CoroutineContext , block : Runnable ) {
44
- DefaultScheduler .dispatchWithContext(block, BlockingContext , false )
44
+ DefaultScheduler .dispatchWithContext(block, BlockingContext , fair = false , track = true )
45
45
}
46
46
47
47
override fun limitedParallelism (parallelism : Int , name : String? ): CoroutineDispatcher {
@@ -58,6 +58,10 @@ private object UnlimitedIoScheduler : CoroutineDispatcher() {
58
58
}
59
59
}
60
60
61
+ internal fun scheduleBackgroundIoTask (block : Runnable ) {
62
+ DefaultScheduler .dispatchWithContext(block, BlockingContext , fair = false , track = false )
63
+ }
64
+
61
65
// Dispatchers.IO
62
66
internal object DefaultIoScheduler : ExecutorCoroutineDispatcher(), Executor {
63
67
@@ -126,8 +130,8 @@ internal open class SchedulerCoroutineDispatcher(
126
130
coroutineScheduler.dispatch(block, fair = true )
127
131
}
128
132
129
- internal fun dispatchWithContext (block : Runnable , context : TaskContext , fair : Boolean ) {
130
- coroutineScheduler.dispatch(block, context, fair)
133
+ internal fun dispatchWithContext (block : Runnable , context : TaskContext , fair : Boolean , track : Boolean ) {
134
+ coroutineScheduler.dispatch(block, context, fair = fair, track = track )
131
135
}
132
136
133
137
override fun close () {
0 commit comments