From 44901ebd97de76d9cfdbca2a87488af4c642ea6b Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Tue, 6 Sep 2022 22:09:29 +0800 Subject: [PATCH] util: Remove the need of _MTX_INITIALIZER_NP by using simple_mtx_t/SIMPLE_MTX_INITIALIZER in u_debug_stack_android.cpp Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- src/util/u_debug_stack_android.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/util/u_debug_stack_android.cpp b/src/util/u_debug_stack_android.cpp index 061707c..be3a889 100644 --- a/src/util/u_debug_stack_android.cpp +++ b/src/util/u_debug_stack_android.cpp @@ -23,13 +23,14 @@ #include +#include "util/simple_mtx.h" #include "util/u_debug.h" #include "u_debug_stack.h" #include "util/hash_table.h" #include "os/os_thread.h" static hash_table *symbol_table; -static mtx_t table_mutex = _MTX_INITIALIZER_NP; +static simple_mtx_t table_mutex = SIMPLE_MTX_INITIALIZER; static const char * intern_symbol(const char *symbol) @@ -67,7 +68,7 @@ debug_backtrace_capture(debug_stack_frame *backtrace, /* Add one to exclude this call. Unwind already ignores itself. */ bt->Unwind(start_frame + 1); - mtx_lock(&table_mutex); + simple_mtx_lock(&table_mutex); for (unsigned i = 0; i < nr_frames; i++) { const backtrace_frame_data_t* frame = bt->GetFrame(i); @@ -82,7 +83,7 @@ debug_backtrace_capture(debug_stack_frame *backtrace, } } - mtx_unlock(&table_mutex); + simple_mtx_unlock(&table_mutex); delete bt; } -- 2.7.4