From 0a87dca4340fc4cf88d30e3e05b81bb5c12a34b7 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 10 Feb 2023 18:40:47 +0800 Subject: [PATCH] hud: Replace usage of mtx_t with simple_mtx_t in hud_sensors_temp.c This is a prepare for removing _MTX_INITIALIZER_NP. Signed-off-by: Yonggang Luo Acked-by: David Heidelberg Acked-by: Eric Engestrom Part-of: --- src/gallium/auxiliary/hud/hud_sensors_temp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c index 96876d3..6dc37e9 100644 --- a/src/gallium/auxiliary/hud/hud_sensors_temp.c +++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c @@ -32,6 +32,7 @@ #include "hud/hud_private.h" #include "util/list.h" #include "util/os_time.h" +#include "util/simple_mtx.h" #include "util/u_thread.h" #include "util/u_memory.h" #include "util/u_string.h" @@ -51,7 +52,7 @@ */ static int gsensors_temp_count = 0; static struct list_head gsensors_temp_list; -static mtx_t gsensor_temp_mutex = _MTX_INITIALIZER_NP; +static simple_mtx_t gsensor_temp_mutex = SIMPLE_MTX_INITIALIZER; struct sensors_temp_info { @@ -328,15 +329,15 @@ int hud_get_num_sensors(bool displayhelp) { /* Return the number of sensors detected. */ - mtx_lock(&gsensor_temp_mutex); + simple_mtx_lock(&gsensor_temp_mutex); if (gsensors_temp_count) { - mtx_unlock(&gsensor_temp_mutex); + simple_mtx_unlock(&gsensor_temp_mutex); return gsensors_temp_count; } int ret = sensors_init(NULL); if (ret) { - mtx_unlock(&gsensor_temp_mutex); + simple_mtx_unlock(&gsensor_temp_mutex); return 0; } @@ -372,7 +373,7 @@ hud_get_num_sensors(bool displayhelp) } } - mtx_unlock(&gsensor_temp_mutex); + simple_mtx_unlock(&gsensor_temp_mutex); return gsensors_temp_count; } -- 2.7.4