Add CoroutineName for input thread

This commit is contained in:
Him188 2020-09-10 09:04:31 +08:00
parent 42a4c844e1
commit 335299275b

View File

@ -10,6 +10,7 @@
package net.mamoe.mirai.console.pure package net.mamoe.mirai.console.pure
import kotlinx.coroutines.CancellationException import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.cancel import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import net.mamoe.mirai.console.MiraiConsole import net.mamoe.mirai.console.MiraiConsole
@ -28,7 +29,7 @@ val consoleLogger by lazy { DefaultLogger("console") }
@OptIn(ConsoleInternalAPI::class) @OptIn(ConsoleInternalAPI::class)
internal fun startupConsoleThread() { internal fun startupConsoleThread() {
MiraiConsole.launch { MiraiConsole.launch(CoroutineName("Input")) {
while (true) { while (true) {
try { try {
val next = MiraiConsole.requestInput("").let { val next = MiraiConsole.requestInput("").let {