Move the log lock to a better location

This commit is contained in:
Ruihan Li
2025-04-15 22:22:07 +08:00
committed by Tate, Hongliang Tian
parent 67e5e5a651
commit d6e40933b8
6 changed files with 46 additions and 73 deletions

View File

@ -15,12 +15,6 @@ impl log::Log for AsterLogger {
fn log(&self, record: &Record) {
let timestamp = Jiffies::elapsed().as_duration().as_secs_f64();
// Use a global lock to prevent interleaving of log messages.
use ostd::sync::SpinLock;
static RECORD_LOCK: SpinLock<()> = SpinLock::new(());
let _lock = RECORD_LOCK.disable_irq().lock();
print_logs(record, timestamp);
}