From 7376287554e30aa0b74136bf6c16566f6bda80cd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Apr 2022 14:27:25 +0200 Subject: Fix race in phase lock contention counting --- build2/b.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build2/b.cxx') 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&) { -- cgit v1.1