From befbb094a058342ad10686090b1c073033a20b43 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 25 Apr 2024 20:18:28 -0400 Subject: [PATCH] Fix warning when NDEBUG macro is enabled. --- include/mutex.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mutex.hpp b/include/mutex.hpp index d924c9f9..030874e3 100644 --- a/include/mutex.hpp +++ b/include/mutex.hpp @@ -18,6 +18,7 @@ struct SharedMutex { SharedMutex() { int err = pthread_rwlock_init(&rwlock, NULL); + (void) err; assert(!err); } ~SharedMutex() { @@ -26,6 +27,7 @@ struct SharedMutex { void lock() { int err = pthread_rwlock_wrlock(&rwlock); + (void) err; assert(!err); } /** Returns whether the lock was acquired. */ @@ -34,11 +36,13 @@ struct SharedMutex { } void unlock() { int err = pthread_rwlock_unlock(&rwlock); + (void) err; assert(!err); } void lock_shared() { int err = pthread_rwlock_rdlock(&rwlock); + (void) err; assert(!err); } /** Returns whether the lock was acquired. */