diff options
Diffstat (limited to 'raul/AtomicInt.hpp')
-rw-r--r-- | raul/AtomicInt.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/raul/AtomicInt.hpp b/raul/AtomicInt.hpp index 2fd624c..172af6b 100644 --- a/raul/AtomicInt.hpp +++ b/raul/AtomicInt.hpp @@ -51,6 +51,11 @@ public: inline int operator+(int val) const { return get() + val; } inline int operator-(int val) const { return get() - val; } + inline bool operator==(const AtomicInt& other) const { + Raul::barrier(); + return _val == other._val; + } + inline AtomicInt& operator+=(int val) { __sync_fetch_and_add(&_val, val); return *this; |