Skip to content
Snippets Groups Projects
Commit bf6f32f1 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

AppScope: no need for GlobalScope anymore

parent b44cb3f7
No related branches found
No related tags found
No related merge requests found
package org.videolan.vlc.util
import android.os.Looper
import kotlinx.coroutines.*
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Runnable
import kotlinx.coroutines.launch
fun runBackground(runnable: Runnable) {
if (Looper.myLooper() != Looper.getMainLooper()) runnable.run()
......@@ -16,6 +19,6 @@ fun runIO(runnable: Runnable) {
AppScope.launch(Dispatchers.IO) { runnable.run() }
}
object AppScope : CoroutineScope by GlobalScope {
object AppScope : CoroutineScope {
override val coroutineContext = Dispatchers.Main.immediate
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment