mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Move the log lock to a better location
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
67e5e5a651
commit
d6e40933b8
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user