aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/ThreadPool
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-14 20:21:56 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2018-09-14 20:21:56 +0200
commit007f165c69f521af0a215c3739c16822e6e2abca (patch)
treeb2f5c7d201c2a28288f8dda092c6ef64601c20bb /unsupported/Eigen/CXX11/src/ThreadPool
parentd7378aae8e87f85fcf825bf3a04501a16aca4780 (diff)
bug #1598: Let MaxSizeVector respect alignment of objects and add a unit test
Diffstat (limited to 'unsupported/Eigen/CXX11/src/ThreadPool')
-rw-r--r--unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h b/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h
index 2cac2d0f1..22c952ae1 100644
--- a/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h
+++ b/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h
@@ -169,7 +169,9 @@ class EventCount {
class Waiter {
friend class EventCount;
- std::atomic<Waiter*> next;
+ // Align to 128 byte boundary to prevent false sharing with other Waiter
+ // objects in the same vector.
+ EIGEN_ALIGN_TO_BOUNDARY(128) std::atomic<Waiter*> next;
std::mutex mu;
std::condition_variable cv;
uint64_t epoch;
@@ -179,9 +181,6 @@ class EventCount {
kWaiting,
kSignaled,
};
- // Pad past 128 byte boundary to prevent false sharing with other Waiter
- // objects in the same vector.
- char pad_[128];
};
private: