Skip to content

Commit

Permalink
fix sync issues in vmexit_stats
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenny committed Sep 2, 2018
1 parent 81906e9 commit db36987
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/hvpp/hvpp/vmexit_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit db36987

Please sign in to comment.