Commit b4120cdd authored by topjohnwu's avatar topjohnwu

IODispatcherExecutor -> DispatcherExecutor

parent 54e3f199
......@@ -7,7 +7,7 @@ import android.content.Context
import android.content.res.Configuration
import android.os.Bundle
import com.topjohnwu.magisk.DynAPK
import com.topjohnwu.magisk.core.utils.IODispatcherExecutor
import com.topjohnwu.magisk.core.utils.DispatcherExecutor
import com.topjohnwu.magisk.core.utils.RootRegistry
import com.topjohnwu.magisk.core.utils.ShellInit
import com.topjohnwu.magisk.core.utils.updateConfig
......@@ -16,6 +16,7 @@ import com.topjohnwu.magisk.ktx.unwrap
import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.internal.UiThreadHandler
import com.topjohnwu.superuser.ipc.RootService
import kotlinx.coroutines.Dispatchers
import timber.log.Timber
import kotlin.system.exitProcess
......@@ -44,7 +45,7 @@ open class App() : Application() {
.setFlags(Shell.FLAG_MOUNT_MASTER)
.setInitializers(ShellInit::class.java)
.setTimeout(2))
Shell.EXECUTOR = IODispatcherExecutor()
Shell.EXECUTOR = DispatcherExecutor(Dispatchers.IO)
// Some context magic
val app: Application
......
......@@ -5,10 +5,10 @@ import java.util.concurrent.AbstractExecutorService
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
class IODispatcherExecutor : AbstractExecutorService() {
class DispatcherExecutor(dispatcher: CoroutineDispatcher) : AbstractExecutorService() {
private val job = SupervisorJob()
private val scope = CoroutineScope(job + Dispatchers.IO)
private val scope = CoroutineScope(job + dispatcher)
private val latch = CountDownLatch(1)
init {
......
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