Type representing an atomic pointer.
|
constexpr | AtomicPointer (T *value=nullptr) |
| Constructor.
|
|
| AtomicPointer (const AtomicPointer &value)=delete |
|
AtomicPointer & | operator= (const AtomicPointer &value)=delete |
|
bool | CompareAndSwap (T *oldval, T *newval) |
| Set a pointer to a new value if it is currently an old value.
|
|
T * | Set (T *v) |
| Set a pointer to a value atomically.
|
|
T * | Get () |
| Get the value of a pointer atomically.
|
|
◆ CompareAndSwap()
Note: If you don't know what this function is for, you shouldn't use it!
- Parameters
-
oldval | the old pointer value. |
newval | the new pointer value. |
- Returns
- true if the pointer was set, false otherwise.
- Thread safety:
- It is safe to call this function from any thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- AtomicInt.CompareAndSwap
-
AtomicPointer.Get
-
AtomicPointer.Set
◆ Get()
Note: If you don't know what this function is for, you shouldn't use it!
- Returns
- the current value of a pointer.
- Thread safety:
- It is safe to call this function from any thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- AtomicPointer.CompareAndSwap
-
AtomicPointer.Set
◆ Set()
Note: If you don't know what this function is for, you shouldn't use it!
- Parameters
-
v | the desired pointer value. |
- Returns
- the previous value of the pointer.
- Thread safety:
- It is safe to call this function from any thread.
- Since
- This function is available since SDL 3.2.0.
- See also
- AtomicPointer.CompareAndSwap
-
AtomicPointer.Get
The documentation for this class was generated from the following file: