增加线程名称

This commit is contained in:
lubeilin
2023-03-30 12:09:12 +08:00
parent 8d76214193
commit 5dcda4d088
5 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -76,11 +76,11 @@ pub fn main0(base_args: BaseArgs) {
log::error!("{:?}", e);
}
let switch1 = switch.clone();
let handle = std::thread::spawn(move || {
let handle = std::thread::Builder::new().name("cmd-server".into()).spawn(move || {
if let Err(e) = command_server.start(switch1) {
log::error!("{:?}", e);
}
});
}).unwrap();
crate::console_listen(&switch);
if let Err(e) = handle.join() {
log::error!("后台任务异常{:?}",e);