| 30 | { |
| 31 | template <typename T> |
| 32 | struct atomic_wrapper |
| 33 | { |
| 34 | std::atomic<T> _a; |
| 35 | |
| 36 | atomic_wrapper() : _a(0) {} |
| 37 | atomic_wrapper(const std::atomic<T> &a) :_a(a.load()) {} |
| 38 | atomic_wrapper(const atomic_wrapper &other) :_a(other._a.load()) {} |
| 39 | atomic_wrapper &operator=(const atomic_wrapper &other) |
| 40 | { |
| 41 | _a.store(other._a.load()); |
| 42 | return *this; |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | inline void addToAtomicReal(std::atomic<Real> & a, const Real & r) |
| 47 | { |