From acc786cb5805d057932ada3e7c571bb8e901cd67 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 6 Dec 2014 23:15:06 +0100 Subject: Begin review of taking model : making things thread safe. --- kernel/l0/dbglog.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/l0/dbglog.c') diff --git a/kernel/l0/dbglog.c b/kernel/l0/dbglog.c index 5a7251b..e042625 100644 --- a/kernel/l0/dbglog.c +++ b/kernel/l0/dbglog.c @@ -1,6 +1,8 @@ #include #include #include +#include + #include #include #include @@ -121,13 +123,17 @@ static void serial_puts(const char *c) { // ================================================================== +STATIC_MUTEX(dbglog_mutex); + void dbglog_setup() { + mutex_lock(&dbglog_mutex); #ifdef DBGLOG_TO_SCREEN vga_init(); #endif #ifdef DBGLOG_TO_SERIAL serial_init(); #endif + mutex_unlock(&dbglog_mutex); } void dbg_print(const char* str) { -- cgit v1.2.3