thread/sema: name the lock temporary to silence a warning

This commit is contained in:
Danny Robson 2023-05-15 10:36:25 +10:00
parent 5721602ef7
commit facba4e799

View File

@ -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;
}
}