From d44f65873b1a00f450346ac9506bcc65ecc2c5d5 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sun, 26 May 2019 17:34:18 +0200 Subject: kern/log: fix bulletin publication --- kern/log.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kern/log.c b/kern/log.c index 2d2206ca..d2970cf4 100644 --- a/kern/log.c +++ b/kern/log.c @@ -55,7 +55,6 @@ static char log_buffer[LOG_BUFFER_SIZE]; static unsigned int log_nr_overruns; -static bool log_bulletin_published; static struct bulletin log_bulletin; /* @@ -146,9 +145,12 @@ log_run(void *arg) { struct log_consumer ctx; unsigned long flags; + bool published; (void)arg; + published = false; + spinlock_lock_intr_save(&log_lock, &flags); log_consumer_init(&ctx, &log_mbuf); @@ -172,9 +174,12 @@ log_run(void *arg) break; } - if (!log_bulletin_published) { + if (!published) { + spinlock_unlock_intr_restore(&log_lock, flags); bulletin_publish(&log_bulletin, 0); - log_bulletin_published = true; + spinlock_lock_intr_save(&log_lock, &flags); + + published = true; } thread_sleep(&log_lock, &log_mbuf, "log_mbuf"); -- cgit v1.2.3