From aebba1f8a7dee9b9ae3e70128ad48de69ca90b15 Mon Sep 17 00:00:00 2001 From: Tommi Rantala Date: Fri, 21 Sep 2012 07:43:41 +0300 Subject: [PATCH] Apply `define_lock()' We have a nice macro for defining pthread mutexes, use it. --- src/arm/Gglobal.c | 2 +- src/hppa/Gglobal.c | 2 +- src/mi/dyn-register.c | 2 +- src/mips/Gglobal.c | 2 +- src/ppc32/Gglobal.c | 2 +- src/ppc64/Gglobal.c | 2 +- src/x86/Gglobal.c | 2 +- src/x86_64/Gglobal.c | 2 +- src/x86_64/Gtrace.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arm/Gglobal.c b/src/arm/Gglobal.c index ce692f7b..b3d3a6d8 100644 --- a/src/arm/Gglobal.c +++ b/src/arm/Gglobal.c @@ -25,7 +25,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t arm_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (arm_lock); HIDDEN int tdep_init_done; /* Unwinding methods to use. See UNW_METHOD_ enums */ diff --git a/src/hppa/Gglobal.c b/src/hppa/Gglobal.c index 849b8e55..2f1b5931 100644 --- a/src/hppa/Gglobal.c +++ b/src/hppa/Gglobal.c @@ -25,7 +25,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" -HIDDEN pthread_mutex_t hppa_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (hppa_lock); HIDDEN int tdep_init_done; HIDDEN void diff --git a/src/mi/dyn-register.c b/src/mi/dyn-register.c index a62d696e..c28954a2 100644 --- a/src/mi/dyn-register.c +++ b/src/mi/dyn-register.c @@ -25,7 +25,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "libunwind_i.h" -HIDDEN pthread_mutex_t _U_dyn_info_list_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (_U_dyn_info_list_lock); void _U_dyn_register (unw_dyn_info_t *di) diff --git a/src/mips/Gglobal.c b/src/mips/Gglobal.c index a29583f7..f2231573 100644 --- a/src/mips/Gglobal.c +++ b/src/mips/Gglobal.c @@ -25,7 +25,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t mips_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (mips_lock); HIDDEN int tdep_init_done; HIDDEN void diff --git a/src/ppc32/Gglobal.c b/src/ppc32/Gglobal.c index 6af97727..e817e094 100644 --- a/src/ppc32/Gglobal.c +++ b/src/ppc32/Gglobal.c @@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t ppc32_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (ppc32_lock); HIDDEN int tdep_init_done; /* The API register numbers are exactly the same as the .eh_frame diff --git a/src/ppc64/Gglobal.c b/src/ppc64/Gglobal.c index 7c5dfc1b..8b46c3d8 100644 --- a/src/ppc64/Gglobal.c +++ b/src/ppc64/Gglobal.c @@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t ppc64_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (ppc64_lock); HIDDEN int tdep_init_done; /* The API register numbers are exactly the same as the .eh_frame diff --git a/src/x86/Gglobal.c b/src/x86/Gglobal.c index 24b388a4..033a788b 100644 --- a/src/x86/Gglobal.c +++ b/src/x86/Gglobal.c @@ -26,7 +26,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t x86_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (x86_lock); HIDDEN int tdep_init_done; /* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */ diff --git a/src/x86_64/Gglobal.c b/src/x86_64/Gglobal.c index 37fe6b0b..cf1e3746 100644 --- a/src/x86_64/Gglobal.c +++ b/src/x86_64/Gglobal.c @@ -29,7 +29,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "unwind_i.h" #include "dwarf_i.h" -HIDDEN pthread_mutex_t x86_64_lock = PTHREAD_MUTEX_INITIALIZER; +HIDDEN define_lock (x86_64_lock); HIDDEN int tdep_init_done; /* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */ diff --git a/src/x86_64/Gtrace.c b/src/x86_64/Gtrace.c index 446610cb..89453a88 100644 --- a/src/x86_64/Gtrace.c +++ b/src/x86_64/Gtrace.c @@ -45,7 +45,7 @@ typedef struct } unw_trace_cache_t; static const unw_tdep_frame_t empty_frame = { 0, UNW_X86_64_FRAME_OTHER, -1, -1, 0, -1, -1 }; -static pthread_mutex_t trace_init_lock = PTHREAD_MUTEX_INITIALIZER; +static define_lock (trace_init_lock); static pthread_once_t trace_cache_once = PTHREAD_ONCE_INIT; static sig_atomic_t trace_cache_once_happen; static pthread_key_t trace_cache_key;