From b8c0196116d3ed68d111a4ede06b22ddf3d2c5c3 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 10 Jul 2020 12:31:51 +0200 Subject: [PATCH] gallium/util: do not use _MTX_INITIALIZER_NP on Windows We already have another way of initializing these, so it's just a matter of avoiding _MTX_INITIALIZER_NP here. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/auxiliary/util/u_debug_refcnt.c | 4 ++++ src/gallium/auxiliary/util/u_debug_symbol.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c index f849e59cb3e..a25234b46cf 100644 --- a/src/gallium/auxiliary/util/u_debug_refcnt.c +++ b/src/gallium/auxiliary/util/u_debug_refcnt.c @@ -53,7 +53,11 @@ static FILE *stream; /* TODO: maybe move this serial machinery to a stand-alone module and * expose it? */ +#ifdef PIPE_OS_WINDOWS +static mtx_t serials_mutex; +#else static mtx_t serials_mutex = _MTX_INITIALIZER_NP; +#endif static struct hash_table *serials_hash; static unsigned serials_last; diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c index 334803d008e..4bbed585d81 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.c +++ b/src/gallium/auxiliary/util/u_debug_symbol.c @@ -271,7 +271,11 @@ debug_symbol_print(const void *addr) } struct hash_table* symbols_hash; +#ifdef PIPE_OS_WINDOWS +static mtx_t symbols_mutex; +#else static mtx_t symbols_mutex = _MTX_INITIALIZER_NP; +#endif const char* debug_symbol_name_cached(const void *addr) -- 2.30.2