summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2011-05-07 00:45:49 -0400
committerMathias Stearn <mathias@10gen.com>2011-05-07 00:46:01 -0400
commitd2c770380f99c67440763ee23a56c5dad6fe9e78 (patch)
tree03dcfc1f17461b7319c6d8d581dcdb5698c075e0
parenta5b1570b4f554232eff6c09c1cc80bea355f752f (diff)
downloadmongo-d2c770380f99c67440763ee23a56c5dad6fe9e78.tar.gz
Revert "Add += and -= operators to AtomicUInt"
This reverts commit 06f6eec33daf40d6513f099774331ea77c74ca62.
-rw-r--r--bson/util/atomic_int.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/bson/util/atomic_int.h b/bson/util/atomic_int.h
index 38a3399f2e3..15735524aa2 100644
--- a/bson/util/atomic_int.h
+++ b/bson/util/atomic_int.h
@@ -36,9 +36,6 @@ namespace mongo {
inline AtomicUInt operator--(); // --prefix
inline AtomicUInt operator--(int); // postfix--
- inline AtomicUInt operator+=(int i);
- inline AtomicUInt operator-=(int i);
-
inline void zero() { x = 0; } // TODO: this isn't thread safe
volatile unsigned x;
@@ -58,12 +55,6 @@ namespace mongo {
AtomicUInt AtomicUInt::operator--(int) {
return InterlockedDecrement((volatile long*)&x)+1;
}
- AtomicUInt AtomicUInt::operator+=(int i) {
- return InterlockedAdd((volatile long*)&x, (long)i);
- }
- AtomicUInt AtomicUInt::operator-=(int i) {
- return InterlockedAdd((volatile long*)&x, (long)-i);
- }
#elif defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
// this is in GCC >= 4.1
AtomicUInt AtomicUInt::operator++() {
@@ -78,12 +69,6 @@ namespace mongo {
AtomicUInt AtomicUInt::operator--(int) {
return __sync_fetch_and_add(&x, -1);
}
- AtomicUInt AtomicUInt::operator+=(int i) {
- return __sync_add_and_fetch(&x, i);
- }
- AtomicUInt AtomicUInt::operator-=(int i) {
- return __sync_add_and_fetch(&x, -i);
- }
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
// from boost 1.39 interprocess/detail/atomic.hpp
@@ -111,12 +96,6 @@ namespace mongo {
AtomicUInt AtomicUInt::operator--(int) {
return atomic_int_helper(&x, -1);
}
- AtomicUInt AtomicUInt::operator+=(int i) {
- return atomic_int_helper(&x, i)+i;
- }
- AtomicUInt AtomicUInt::operator-=(int i) {
- return atomic_int_helper(&x, -i)-i;
- }
#else
# error "unsupported compiler or platform"
#endif