Atomic Bit Test/Set Intrinsics with Limited Retries

These intrinsics have the following declarations:

int __TESTBITCCI3( void *, int, int );
int __TESTBITSSI3( void *, int, int );

These intrinsics function similarly to the two argument versions described in the previous section, with the addition of a third argument used to specify the maximum number of attempts to acquire the memory interlock. The intrinsics return 0 if the interlock was successfully acquired and the bit specified changed state as the result of the operation.

These intrinsics do not contain memory barrier instructions; you are responsible for adding them as required.