Commit f56af830 authored by Geoffrey Métais's avatar Geoffrey Métais

Improve AppScope implementation

parent 3525cabb
package org.videolan.vlc.util
import android.os.Looper
import kotlinx.coroutines.experimental.CoroutineScope
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.experimental.Runnable
import kotlinx.coroutines.experimental.launch
import kotlin.coroutines.experimental.CoroutineContext
import kotlinx.coroutines.experimental.*
fun runBackground(runnable: Runnable) {
if (Looper.myLooper() != Looper.getMainLooper())
......@@ -20,14 +16,6 @@ fun runIO(runnable: Runnable) {
AppScope.launch(Dispatchers.IO) { }
object AppScope : CoroutineScope {
* @suppress **Deprecated**: Deprecated in favor of top-level extension property
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Deprecated in favor of top-level extension property")
override val isActive: Boolean
get() = true
override val coroutineContext: CoroutineContext
get() = Dispatchers.Main.immediate
object AppScope : CoroutineScope by GlobalScope {
override val coroutineContext = Dispatchers.Main.immediate
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment