aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2018-08-14 12:17:46 -0700
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2018-08-14 12:17:46 -0700
commit15d4f515e2d4982bd16f0a85a7bbb5343270deec (patch)
tree98090c0b1fa82b84559ecdb9a2dae4b89765f420 /unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h
parent6d6e7b7027c7286d1ba7fe540d1a7e93a379d9c5 (diff)
Use plain_assert in destructors to avoid throwing in CXX11 tests where main.h owerwrites eigen_assert with a throwing version.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h')
-rw-r--r--unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h b/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h
index c37fc1e65..ef5e9ff18 100644
--- a/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h
+++ b/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h
@@ -20,9 +20,7 @@ class Barrier {
Barrier(unsigned int count) : state_(count << 1), notified_(false) {
eigen_assert(((count << 1) >> 1) == count);
}
- ~Barrier() {
- eigen_assert((state_>>1) == 0);
- }
+ ~Barrier() { eigen_plain_assert((state_ >> 1) == 0); }
void Notify() {
unsigned int v = state_.fetch_sub(2, std::memory_order_acq_rel) - 2;
@@ -52,14 +50,13 @@ class Barrier {
bool notified_;
};
-
// Notification is an object that allows a user to to wait for another
// thread to signal a notification that an event has occurred.
//
// Multiple threads can wait on the same Notification object,
// but only one caller must call Notify() on the object.
struct Notification : Barrier {
- Notification() : Barrier(1) {};
+ Notification() : Barrier(1){};
};
} // namespace Eigen