package kotlinx.coroutines; import java.util.concurrent.Executor; /* loaded from: classes5.dex */ public abstract class ExecutorsKt { public static final CoroutineDispatcher from(Executor executor) { CoroutineDispatcher coroutineDispatcher; DispatcherExecutor dispatcherExecutor = executor instanceof DispatcherExecutor ? (DispatcherExecutor) executor : null; return (dispatcherExecutor == null || (coroutineDispatcher = dispatcherExecutor.dispatcher) == null) ? new ExecutorCoroutineDispatcherImpl(executor) : coroutineDispatcher; } public static final Executor asExecutor(CoroutineDispatcher coroutineDispatcher) { Executor executor; ExecutorCoroutineDispatcher executorCoroutineDispatcher = coroutineDispatcher instanceof ExecutorCoroutineDispatcher ? (ExecutorCoroutineDispatcher) coroutineDispatcher : null; return (executorCoroutineDispatcher == null || (executor = executorCoroutineDispatcher.getExecutor()) == null) ? new DispatcherExecutor(coroutineDispatcher) : executor; } }