aboutsummaryrefslogtreecommitdiff
path: root/build2/b.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-08 14:27:25 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-08 14:27:25 +0200
commit7376287554e30aa0b74136bf6c16566f6bda80cd (patch)
tree13b323d5a0b9eca9c5a3648aa099c48a80eb889c /build2/b.cxx
parent70f7fd69b448263fc27b9dceba1663810f4885ab (diff)
Fix race in phase lock contention counting
Diffstat (limited to 'build2/b.cxx')
-rw-r--r--build2/b.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index e615ef5..b14da09 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -423,7 +423,8 @@ main (int argc, char* argv[])
{
if (pctx != nullptr)
{
- phase_switch_contention += pctx->phase_mutex.contention;
+ phase_switch_contention += (pctx->phase_mutex.contention +
+ pctx->phase_mutex.contention_load);
pctx = nullptr; // Free first to reuse memory.
}
@@ -1402,7 +1403,8 @@ main (int argc, char* argv[])
}
#endif
- phase_switch_contention += pctx->phase_mutex.contention;
+ phase_switch_contention += (pctx->phase_mutex.contention +
+ pctx->phase_mutex.contention_load);
}
catch (const failed&)
{