[#BloombergLP-bsls-AtomicOperations_DefaultPointer32-testAndSwapPtrAcqRel]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/AtomicOperations_DefaultPointer32.adoc[AtomicOperations&lowbar;DefaultPointer32]::testAndSwapPtrAcqRel
:relfileprefix: ../../../
:mrdocs:

Conditionally set the value of the specified `atomicPtr` to the specified `swapValue` if and only if the value of `atomicPtr` equals the value of the specified `compareValue`, and return the initial value of `atomicPtr`, providing the acquire&sol;release memory ordering guarantee&period; The whole operation is performed atomically&period;

== Synopsis

Declared in `&lt;bsls&lowbar;atomicoperations&lowbar;default&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void*
testAndSwapPtrAcqRel(
    AtomicTypes::Pointer* atomicPtr,
    void* compareValue,
    void* swapValue);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
