util: Make debug_dump_flags thread safe

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33491>
This commit is contained in:
Danylo Piliaiev 2025-02-11 11:31:01 +01:00 committed by Marge Bot
parent 30a3d567c8
commit 0886eda4f1

View file

@ -30,6 +30,7 @@
#include "util/u_debug.h"
#include "util/u_string.h"
#include "util/u_math.h"
#include "c11/threads.h"
#include <inttypes.h>
#include <stdio.h>
@ -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';