Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ACE_Barrier running_threads_ to atomic to ensure accurate values across cores/CPUs #2170

Merged
merged 3 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <atomic>
#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_;
std::atomic<int> running_threads_;

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