Skip to content

Commit

Permalink
Two small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jprotze committed Mar 6, 2024
1 parent 5a01bd5 commit 4b185a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions nestkernel/per_thread_bool_indicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ PerThreadBoolIndicator::all_false() const
// We need two barriers here to ensure that no thread can continue and change the result
// before all threads have determined the result.
#pragma omp barrier
// We need two barriers here to ensure that no thread can continue and change the result
// before all threads have determined the result.
bool ret = ( are_true_ == 0 );
#pragma omp barrier
return ret;
Expand Down
5 changes: 3 additions & 2 deletions nestkernel/per_thread_bool_indicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define PER_THREAD_BOOL_INDICATOR_H

// C++ includes:
#include <atomic>
#include <cassert>
#include <cstddef>
#include <cstdint>
Expand Down Expand Up @@ -165,8 +166,8 @@ class PerThreadBoolIndicator

private:
std::vector< BoolIndicatorUInt64 > per_thread_status_;
std::atomic< int > size_ { 0 };
int size_ { 0 };

/** Number of per-thread indicators currently true
*
* are_true_ == 0 -> all are false
Expand Down

0 comments on commit 4b185a4

Please sign in to comment.