From 25c42c475fb12c867d924f255a2f14b1487d514f Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:38:59 +0800 Subject: [PATCH] newFixedThreadPool(Runtime.getRuntime().availableProcessors()) --- .../src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt index 52742312..372cf714 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt @@ -24,7 +24,7 @@ import libv2ray.Libv2ray import java.util.concurrent.Executors class V2RayTestService : Service() { - private val realTestScope by lazy { CoroutineScope(Executors.newFixedThreadPool(2).asCoroutineDispatcher()) } + private val realTestScope by lazy { CoroutineScope(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()).asCoroutineDispatcher()) } override fun onCreate() { super.onCreate()