- /* The _pointer_ is volatile, not the listhead itself */
- void * volatile oldListHead;
- void * volatile newListHead = inNewLink;
- void * volatile * newLinkNextPtr = (void * volatile *) (((char *) inNewLink) + inOffset);
-
- do {
- oldListHead = *inList;
- *newLinkNextPtr = oldListHead;
- } while (! OSCompareAndSwap((UInt32)oldListHead, (UInt32)newListHead,
- (volatile UInt32 *)inList));