logging: make term and printf smp safe

This commit is contained in:
Matheus
2023-10-01 19:09:28 -03:00
parent 1bb152b446
commit ba16aa366f
7 changed files with 39 additions and 2 deletions
+8
View File
@@ -1,3 +1,7 @@
#include <mutex.h>
mutex_t printf_mutex;
static void nohook(char c) {
}
@@ -12,3 +16,7 @@ void _putchar(char c) {
void logging_sethook(void (*fun)(char)) {
hook = fun;
}
void logging_init() {
MUTEX_INIT(&printf_mutex);
}