diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2011-02-17 11:18:02 +0000 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2011-02-18 14:46:23 +0000 |
commit | 52ad45677dd3d8a50836edea9f5841aa12d70419 (patch) | |
tree | 28dc22849ffc110ed348bbd49871aa696c48b3bd /src/gallium/auxiliary/util/u_debug_refcnt.c | |
parent | d252db7af1370246c76b46f4b9e66b352879bd9b (diff) |
util: Make refcnt and symbol debuggers work on windows
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/util/u_debug_refcnt.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_debug_refcnt.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_debug_refcnt.c b/src/gallium/auxiliary/util/u_debug_refcnt.c index 40a26c9c69..6f706a35fd 100644 --- a/src/gallium/auxiliary/util/u_debug_refcnt.c +++ b/src/gallium/auxiliary/util/u_debug_refcnt.c @@ -43,7 +43,8 @@ int debug_refcnt_state; struct os_stream* stream; /* TODO: maybe move this serial machinery to a stand-alone module and expose it? */ -static pipe_mutex serials_mutex; +pipe_static_mutex(serials_mutex); + static struct util_hash_table* serials_hash; static unsigned serials_last; @@ -66,6 +67,15 @@ static boolean debug_serial(void* p, unsigned* pserial) { unsigned serial; boolean found = TRUE; +#ifdef PIPE_SUBSYSTEM_WINDOWS_USER + static boolean first = TRUE; + + if (first) { + pipe_mutex_init(serials_mutex); + first = FALSE; + } +#endif + pipe_mutex_lock(serials_mutex); if(!serials_hash) serials_hash = util_hash_table_create(hash_ptr, compare_ptr); |