aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-08 08:10:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-08 08:10:32 +0200
commit230e7cb0bab4582132de2bc411e355eacbacff4a (patch)
tree166ca16718762b679777b6fb198dc053187d3c89 /libbuild2/context.hxx
parentd8cba1bae2b0212c7f8bc5af5c33709a6e622510 (diff)
Add phase switch contention to build statistics
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index ef628c9..0595413 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -43,6 +43,11 @@ namespace build2
bool
relock (run_phase unlock, run_phase lock);
+ // Statistics.
+ //
+ public:
+ size_t contention = 0; // # of contentious phase (re)locks.
+
private:
friend class context;
@@ -61,7 +66,7 @@ namespace build2
// is exclusive so we have a separate mutex to serialize it (think of it
// as a second level locking).
//
- // When the mutex is unlocked (all three counters become zero, the phase
+ // When the mutex is unlocked (all three counters become zero), the phase
// is always changed to load (this is also the initial state).
//
context& ctx_;