MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / atomic_wrapper

Class atomic_wrapper

SPlisHSPlasH/PF/TimeStepPF.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 2

storeMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected