summaryrefslogtreecommitdiff
path: root/indra/llcommon/llapr.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-06-27 16:16:56 -0500
committerDave Parks <davep@lindenlab.com>2013-06-27 16:16:56 -0500
commit380785e613b9823cb6160be5678e5f01783fee5f (patch)
treedce0f35d02994c861428683b91f64371e9a64ea0 /indra/llcommon/llapr.h
parent21b78d7368f969fdf0daf7994fb565da633b1e71 (diff)
parent4696eeeb30ce4d01c3bcbe74c9024f05d848968a (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-development-materials
Diffstat (limited to 'indra/llcommon/llapr.h')
-rwxr-xr-xindra/llcommon/llapr.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 752574c65d..1fe7d98472 100755
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -164,14 +164,20 @@ public:
~LLAtomic32<Type>() {};
operator const Type() { apr_uint32_t data = apr_atomic_read32(&mData); return Type(data); }
+
+ Type CurrentValue() const { apr_uint32_t data = apr_atomic_read32(const_cast< volatile apr_uint32_t* >(&mData)); return Type(data); }
+
Type operator =(const Type& x) { apr_atomic_set32(&mData, apr_uint32_t(x)); return Type(mData); }
void operator -=(Type x) { apr_atomic_sub32(&mData, apr_uint32_t(x)); }
void operator +=(Type x) { apr_atomic_add32(&mData, apr_uint32_t(x)); }
Type operator ++(int) { return apr_atomic_inc32(&mData); } // Type++
Type operator --(int) { return apr_atomic_dec32(&mData); } // approximately --Type (0 if final is 0, non-zero otherwise)
+
+ Type operator ++() { return apr_atomic_inc32(&mData); } // Type++
+ Type operator --() { return apr_atomic_dec32(&mData); } // approximately --Type (0 if final is 0, non-zero otherwise)
private:
- apr_uint32_t mData;
+ volatile apr_uint32_t mData;
};
typedef LLAtomic32<U32> LLAtomicU32;