From 0886eda4f1ac1a8af115607b88325d1ccdaca906 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 11 Feb 2025 11:31:01 +0100 Subject: [PATCH] util: Make debug_dump_flags thread safe Signed-off-by: Danylo Piliaiev Part-of: --- src/util/u_debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/u_debug.c b/src/util/u_debug.c index 7282179c122..f14a260622c 100644 --- a/src/util/u_debug.c +++ b/src/util/u_debug.c @@ -30,6 +30,7 @@ #include "util/u_debug.h" #include "util/u_string.h" #include "util/u_math.h" +#include "c11/threads.h" #include #include @@ -378,8 +379,8 @@ debug_dump_enum(const struct debug_named_value *names, const char * debug_dump_flags(const struct debug_named_value *names, uint64_t value) { - static char output[4096]; - static char rest[256]; + static thread_local char output[4096]; + static thread_local char rest[256]; int first = 1; output[0] = '\0';