Skip to content

Commit

Permalink
Change running_count_ to atomic to ensure accurate values across core…
Browse files Browse the repository at this point in the history
…s/CPUs.
  • Loading branch information
shuston committed Dec 1, 2023
1 parent c2e5ac0 commit 7e06ab1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ACE/ace/Barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL

#else /* ACE_HAS_THREADS */

#include "ace/Atomic_Op.h"
#include "ace/Condition_Thread_Mutex.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL
Expand All @@ -63,7 +64,7 @@ struct ACE_Export ACE_Sub_Barrier
ACE_Condition_Thread_Mutex barrier_finished_;

/// Number of threads that are still running.
int running_threads_;
ACE_Atomic_Op<ACE_Thread_Mutex, int> running_threads_;

/// Dump the state of an object.
void dump () const;
Expand Down

0 comments on commit 7e06ab1

Please sign in to comment.