|
@@ -18,7 +18,7 @@
|
|
|
// Access: Public, Static
|
|
// Access: Public, Static
|
|
|
// Description: Atomically increments the indicated variable.
|
|
// Description: Atomically increments the indicated variable.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE void AtomicAdjustDummyImpl::
|
|
|
inc(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
inc(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
++var;
|
|
++var;
|
|
|
}
|
|
}
|
|
@@ -30,7 +30,7 @@ inc(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
// returns true if the new value is nonzero, false if it
|
|
// returns true if the new value is nonzero, false if it
|
|
|
// is zero.
|
|
// is zero.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE bool AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE bool AtomicAdjustDummyImpl::
|
|
|
dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
return (--var) != 0;
|
|
return (--var) != 0;
|
|
|
}
|
|
}
|
|
@@ -41,7 +41,7 @@ dec(TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
// Description: Atomically computes var += delta. It is legal for
|
|
// Description: Atomically computes var += delta. It is legal for
|
|
|
// delta to be negative.
|
|
// delta to be negative.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE void AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE void AtomicAdjustDummyImpl::
|
|
|
add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer delta) {
|
|
add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer delta) {
|
|
|
var += delta;
|
|
var += delta;
|
|
|
}
|
|
}
|
|
@@ -52,7 +52,7 @@ add(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Intege
|
|
|
// Description: Atomically changes the indicated variable and
|
|
// Description: Atomically changes the indicated variable and
|
|
|
// returns the original value.
|
|
// returns the original value.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
set(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer new_value) {
|
|
set(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Integer new_value) {
|
|
|
Integer orig_value = var;
|
|
Integer orig_value = var;
|
|
|
var = new_value;
|
|
var = new_value;
|
|
@@ -68,7 +68,7 @@ set(TVOLATILE AtomicAdjustDummyImpl::Integer &var, AtomicAdjustDummyImpl::Intege
|
|
|
// asynchronously setting, incrementing, or decrementing
|
|
// asynchronously setting, incrementing, or decrementing
|
|
|
// (via other AtomicAjust methods).
|
|
// (via other AtomicAjust methods).
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
get(const TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
get(const TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
return var;
|
|
return var;
|
|
|
}
|
|
}
|
|
@@ -79,8 +79,8 @@ get(const TVOLATILE AtomicAdjustDummyImpl::Integer &var) {
|
|
|
// Description: Atomically changes the indicated variable and
|
|
// Description: Atomically changes the indicated variable and
|
|
|
// returns the original value.
|
|
// returns the original value.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
|
|
-set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var,
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
|
|
+set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var,
|
|
|
AtomicAdjustDummyImpl::Pointer new_value) {
|
|
AtomicAdjustDummyImpl::Pointer new_value) {
|
|
|
Pointer orig_value = var;
|
|
Pointer orig_value = var;
|
|
|
var = new_value;
|
|
var = new_value;
|
|
@@ -96,7 +96,7 @@ set_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &var,
|
|
|
// asynchronously setting, incrementing, or decrementing
|
|
// asynchronously setting, incrementing, or decrementing
|
|
|
// (via other AtomicAjust methods).
|
|
// (via other AtomicAjust methods).
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
get_ptr(const TVOLATILE AtomicAdjustDummyImpl::Pointer &var) {
|
|
get_ptr(const TVOLATILE AtomicAdjustDummyImpl::Pointer &var) {
|
|
|
return var;
|
|
return var;
|
|
|
}
|
|
}
|
|
@@ -104,15 +104,15 @@ get_ptr(const TVOLATILE AtomicAdjustDummyImpl::Pointer &var) {
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: AtomicAdjustDummyImpl::compare_and_exchange
|
|
// Function: AtomicAdjustDummyImpl::compare_and_exchange
|
|
|
// Access: Public, Static
|
|
// Access: Public, Static
|
|
|
-// Description: Atomic compare and exchange.
|
|
|
|
|
|
|
+// Description: Atomic compare and exchange.
|
|
|
//
|
|
//
|
|
|
// If mem is equal to old_value, store new_value in mem.
|
|
// If mem is equal to old_value, store new_value in mem.
|
|
|
// In either case, return the original value of mem.
|
|
// In either case, return the original value of mem.
|
|
|
// The caller can test for success by comparing
|
|
// The caller can test for success by comparing
|
|
|
// return_value == old_value.
|
|
// return_value == old_value.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
|
|
-compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem,
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Integer AtomicAdjustDummyImpl::
|
|
|
|
|
+compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem,
|
|
|
AtomicAdjustDummyImpl::Integer old_value,
|
|
AtomicAdjustDummyImpl::Integer old_value,
|
|
|
AtomicAdjustDummyImpl::Integer new_value) {
|
|
AtomicAdjustDummyImpl::Integer new_value) {
|
|
|
Integer orig_value = mem;
|
|
Integer orig_value = mem;
|
|
@@ -125,12 +125,12 @@ compare_and_exchange(TVOLATILE AtomicAdjustDummyImpl::Integer &mem,
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: AtomicAdjustDummyImpl::compare_and_exchange_ptr
|
|
// Function: AtomicAdjustDummyImpl::compare_and_exchange_ptr
|
|
|
// Access: Public, Static
|
|
// Access: Public, Static
|
|
|
-// Description: Atomic compare and exchange.
|
|
|
|
|
|
|
+// Description: Atomic compare and exchange.
|
|
|
//
|
|
//
|
|
|
// As above, but works on pointers instead of integers.
|
|
// As above, but works on pointers instead of integers.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
|
|
-compare_and_exchange_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &mem,
|
|
|
|
|
|
|
+ALWAYS_INLINE AtomicAdjustDummyImpl::Pointer AtomicAdjustDummyImpl::
|
|
|
|
|
+compare_and_exchange_ptr(TVOLATILE AtomicAdjustDummyImpl::Pointer &mem,
|
|
|
AtomicAdjustDummyImpl::Pointer old_value,
|
|
AtomicAdjustDummyImpl::Pointer old_value,
|
|
|
AtomicAdjustDummyImpl::Pointer new_value) {
|
|
AtomicAdjustDummyImpl::Pointer new_value) {
|
|
|
Pointer orig_value = mem;
|
|
Pointer orig_value = mem;
|