From facba4e799c81169776d7f3365c5c9edee42953d Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 15 May 2023 10:36:25 +1000 Subject: [PATCH] thread/sema: name the lock temporary to silence a warning --- test/thread/semaphore.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/thread/semaphore.cpp b/test/thread/semaphore.cpp index 24fee205..65fddb87 100644 --- a/test/thread/semaphore.cpp +++ b/test/thread/semaphore.cpp @@ -11,8 +11,10 @@ void fight (cruft::thread::semaphore &sem, const int iterations) { - for (int i = 0; i < iterations; ++i) - std::lock_guard {sem}; + for (int i = 0; i < iterations; ++i) { + std::lock_guard tmp {sem}; + (void)tmp; + } }