Note

This is an atomic read-modify-write operation for the memory location comprising *this.

Std::Atomic_Fetch_Sub Nonmember Function

Atomically reads the value from an atomic<T*> instance and replaces it with that value minus the supplied value i using standard pointer arithmetic rules.

Declaration

T* atomic_fetch_sub(volatile atomic<T*>* p, ptrdiff_t i) noexcept;
T* atomic_fetch_sub(atomic<T*>* p, ptrdiff_t i) noexcept;

Effects

return p->fetch_sub(i);
Std::Atomic_Fetch_Sub_Explicit Nonmember Function

Atomically reads the value from an atomic<T*> instance and replaces it with that value minus the supplied value i using standard pointer arithmetic rules.

Declaration

T* atomic_fetch_sub_explicit( volatile atomic<T*>* p, ptrdiff_t ...

Get C++ Concurrency in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.