These two intrinsic functions allow for interlocked access to single bit memory data with the possibility of infinite retries in the presence of contention for access to the target memory. These functions have the following declarations:
int __TESTBITCCI2( void *, int );
int __TESTBITSSI2( void *, int );
The first argument to these intrinsics is a pointer to the base of an array of bits. The second argument is a zero-based bit number used to specify which bit in the array to set _ _TESTBITSSI2 or clear _ _TESTBITCCI2.
These intrinsics always return 1.
In the presence of contention with another thread to interlock the quadword memory location containing the bit of interest, these intrinsics will spinlock in a compute-intensive fashion in an attempt to acquire the memory interlock.
Note that these intrinsics do not contain memory barrier instructions; you are responsible for adding them as required.