From b75ff8cd5c2ac1a1bd88ddf513f3a07a570eafcf Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 17 Aug 2019 15:23:18 +0200 Subject: Tweak deadlock detection thread wait time --- libbuild2/scheduler.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libbuild2/scheduler.cxx b/libbuild2/scheduler.cxx index 37220c7..3c06176 100644 --- a/libbuild2/scheduler.cxx +++ b/libbuild2/scheduler.cxx @@ -832,16 +832,16 @@ namespace build2 size_t op (s.progress_.load (memory_order_relaxed)), np (op); l.unlock (); - for (size_t i (0), n (10000), m (9900); op == np && i != n; ++i) + for (size_t i (0), n (10000), m (9990); op == np && i != n; ++i) { // On the last few iterations sleep a bit instead of yielding (in // case yield() is a noop; we use the consume order for the same // reason). // - if (i < m) + if (i <= m) this_thread::yield (); else - active_sleep (1ms); + active_sleep ((i - m) * 10ms); np = s.progress_.load (memory_order_consume); } -- cgit v1.1