From f55c727d3b77c64e7e748fae36642cd81b56e4fc Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sun, 31 Jul 2022 15:26:06 +0100 Subject: [PATCH] Fix thread.c warnings on release build --- src/thread.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/thread.c b/src/thread.c index c87e2f9c..b45f7c96 100644 --- a/src/thread.c +++ b/src/thread.c @@ -109,9 +109,12 @@ static parking_bay_t parking_bays[PARKING_BAYS] = { } }; +#ifdef DEBUG static lock_stats_t lock_stats[MAX_THREADS]; -static unsigned max_workers = 0; -static int last_thread_id = -1; +#endif + +static unsigned max_workers = 0; +static int last_thread_id = -1; static __thread nvc_thread_t *my_thread = NULL; @@ -283,8 +286,7 @@ static void lock_unpark_cb(parking_bay_t *bay, void *cookie) { nvc_lock_t *lock = cookie; - const int8_t state = relaxed_load(lock); - assert(state == (IS_LOCKED | HAS_PARKED)); + assert(relaxed_load(lock) == (IS_LOCKED | HAS_PARKED)); // Unlock must have release semantics atomic_store(lock, (bay->parked > 0 ? HAS_PARKED : 0)); -- 2.39.2