diff --git a/tests/include/mir/test/barrier.h b/tests/include/mir/test/barrier.h index 2d349c78bf1..e1f8f7d118c 100644 --- a/tests/include/mir/test/barrier.h +++ b/tests/include/mir/test/barrier.h @@ -38,7 +38,7 @@ class Barrier void ready() { std::unique_lock lock(mutex); - if (--wait_threads) + if ((--wait_threads) > 0) { if (!cv.wait_for(lock, std::chrono::minutes(1), [&]{ return wait_threads == 0; })) throw std::runtime_error("Timeout");