Mesa (master): gallium/util: do not use _MTX_INITIALIZER_NP on Windows

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 16 10:25:40 UTC 2020


Module: Mesa
Branch: master
Commit: b8c0196116d3ed68d111a4ede06b22ddf3d2c5c3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8c0196116d3ed68d111a4ede06b22ddf3d2c5c3

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Fri Jul 10 12:31:51 2020 +0200

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 <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5902>

---

 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)



More information about the mesa-commit mailing list