diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-14 13:42:04 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-14 13:42:04 +0000 |
| commit | 9aa9429135930fcdb51c99c908c604d348443212 (patch) | |
| tree | 9dd9ec88221aaf675bc46ba5ac2e0b78002aad34 /src/main.cpp | |
| parent | 518f30e52307e12fe184c34f0da8f197b976ced5 (diff) | |
Update `debugf` usage
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 60f27a5a7..de7fea344 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,13 +27,17 @@ gb_internal void thread_pool_wait(void) { } +gb_global BlockingMutex debugf_mutex; + gb_internal void debugf(char const *fmt, ...) { if (build_context.show_debug_messages) { + mutex_lock(&debugf_mutex); gb_printf_err("[DEBUG] "); va_list va; va_start(va, fmt); (void)gb_printf_err_va(fmt, va); va_end(va); + mutex_unlock(&debugf_mutex); } } |