aboutsummaryrefslogtreecommitdiff
path: root/build2/scheduler.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-17 14:41:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-17 14:41:39 +0200
commitb936faf3601ea2f1d89dbe3472f9f2e54eda97e7 (patch)
treea6effaca0ed189060db849152c0e0410e19e9643 /build2/scheduler.txx
parent5a686c5460e9fbb32af5014d0dbf1169ea301ec2 (diff)
Minor scheduler optimization
Diffstat (limited to 'build2/scheduler.txx')
-rw-r--r--build2/scheduler.txx9
1 files changed, 5 insertions, 4 deletions
diff --git a/build2/scheduler.txx b/build2/scheduler.txx
index 3410b6f..684409c 100644
--- a/build2/scheduler.txx
+++ b/build2/scheduler.txx
@@ -70,14 +70,15 @@ namespace build2
size_t om (m);
m = task_queue_depth_;
+ ql.unlock ();
+ forward<F> (f) (forward<A> (a)...); // Should not throw.
+
+ if (om != task_queue_depth_)
{
- ql.unlock ();
- forward<F> (f) (forward<A> (a)...); // Should not throw.
ql.lock ();
+ m = s == 0 ? t : om;
}
- m = s == 0 ? t : om;
-
return false;
}
}