From 335299275b80993a3376aaf6688c7c939855dafb Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 10 Sep 2020 09:04:31 +0800 Subject: [PATCH] Add CoroutineName for input thread --- .../main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt b/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt index c2f285cde..66408bb71 100644 --- a/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt +++ b/frontend/mirai-console-pure/src/main/kotlin/net/mamoe/mirai/console/pure/ConsoleThread.kt @@ -10,6 +10,7 @@ package net.mamoe.mirai.console.pure import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import net.mamoe.mirai.console.MiraiConsole @@ -28,7 +29,7 @@ val consoleLogger by lazy { DefaultLogger("console") } @OptIn(ConsoleInternalAPI::class) internal fun startupConsoleThread() { - MiraiConsole.launch { + MiraiConsole.launch(CoroutineName("Input")) { while (true) { try { val next = MiraiConsole.requestInput("").let {