__sync_and_and_fetch
Purpose
This function performs an atomic bitwise AND operation on the variable __v with the variable that __p points to. The result is stored in the address that is specified by __p.
A full memory barrier is created when this function is invoked.
Prototype
T __sync_and_and_fetch (T* __p, U __v, ...);
Parameters
- __p
- The pointer of a variable on which the bitwise AND operation is to be performed. The value of this variable is to be changed to the result of the operation.
- __v
- The variable with which the bitwise AND operation is to be performed.
Return value
The function returns the new value of the variable that __p points to.