servers, util: fix deadlock caused by conflicting lock order (#3340)

This commit is contained in:
Boqin Qin
2020-06-09 04:59:17 +08:00
committed by GitHub
parent c54568e69f
commit 992d450e0a
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -150,6 +150,8 @@ pub fn init_logger(config: Option<LoggingConfig>, logs_tx: Option<mpsc::SyncSend
*tui_running_ref = true;
}
let mut was_init_ref = WAS_INIT.lock();
// Save current logging configuration
let mut config_ref = LOGGING_CONFIG.lock();
*config_ref = c.clone();
@@ -250,7 +252,6 @@ pub fn init_logger(config: Option<LoggingConfig>, logs_tx: Option<mpsc::SyncSend
);
// Mark logger as initialized
let mut was_init_ref = WAS_INIT.lock();
*was_init_ref = true;
}