From 52ad45677dd3d8a50836edea9f5841aa12d70419 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 17 Feb 2011 11:18:02 +0000 Subject: util: Make refcnt and symbol debuggers work on windows Signed-off-by: Jakob Bornecrantz --- src/gallium/auxiliary/util/u_debug_symbol.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/util/u_debug_symbol.c') diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c b/src/gallium/auxiliary/util/u_debug_symbol.c index cb03930a67..bae9be87a2 100644 --- a/src/gallium/auxiliary/util/u_debug_symbol.c +++ b/src/gallium/auxiliary/util/u_debug_symbol.c @@ -196,7 +196,7 @@ debug_symbol_print(const void *addr) } struct util_hash_table* symbols_hash; -pipe_mutex symbols_mutex; +pipe_static_mutex(symbols_mutex); static unsigned hash_ptr(void* p) { @@ -217,6 +217,15 @@ const char* debug_symbol_name_cached(const void *addr) { const char* name; +#ifdef PIPE_SUBSYSTEM_WINDOWS_USER + static boolean first = TRUE; + + if (first) { + pipe_mutex_init(symbols_mutex); + first = FALSE; + } +#endif + pipe_mutex_lock(symbols_mutex); if(!symbols_hash) symbols_hash = util_hash_table_create(hash_ptr, compare_ptr); -- cgit v1.2.3