Fix UIThread stopping runtime from shutdown

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-19 02:07:43 +10:00
parent d4eb56d017
commit 5b0a97f380
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -1,10 +1,10 @@
use std::io::{self, BufRead, Write};
use std::thread;
use bytes::Bytes;
use log::LevelFilter;
use std::sync::mpsc as mpsc_sync;
use tokio::sync::mpsc;
use tokio::task::spawn_blocking;
use super::ui_thread_logger::UIThreadLogger;
use crate::BinstallError;
@ -36,7 +36,7 @@ impl UIThreadInner {
let (request_tx, request_rx) = mpsc_sync::sync_channel(50);
let (confirm_tx, confirm_rx) = mpsc::channel(10);
spawn_blocking(move || {
thread::spawn(move || {
// This task should be the only one able to
// access stdin
let mut stdin = io::stdin().lock();