diff --git a/src/hvpp/hvpp/vmexit_stats.cpp b/src/hvpp/hvpp/vmexit_stats.cpp index 96a6c18..7d314d5 100644 --- a/src/hvpp/hvpp/vmexit_stats.cpp +++ b/src/hvpp/hvpp/vmexit_stats.cpp @@ -47,15 +47,10 @@ void vmexit_stats_handler::invoke_termination() noexcept { vmexit_handler::invoke_termination(); - // - // Increment number of terminated VCPUs. - // - terminated_vcpu_count_ += 1; - // // Are we the last terminated VCPU? // - if (terminated_vcpu_count_ == mp::cpu_count()) + if (terminated_vcpu_count_.fetch_add(1) == (mp::cpu_count() - 1)) { // // Handler saves statistics separately for each VCPU.