diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-17 15:23:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-17 15:23:18 +0200 |
commit | b75ff8cd5c2ac1a1bd88ddf513f3a07a570eafcf (patch) | |
tree | 8f52c233b1c818f9b822bafb76dea2a7b76bb571 /libbuild2 | |
parent | 542471bc3c537bd82998a80be6d4bdd8fb4b9947 (diff) |
Tweak deadlock detection thread wait time
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/scheduler.cxx | 6 |
1 files 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); } |