vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

cmpswap.c (173B)


      1 #include <libkern/OSAtomic.h>
      2 
      3 int
      4 oscmpswap(long *addr, long oldValue, long newValue)
      5 {
      6 	if (OSAtomicCompareAndSwapLong(oldValue, newValue, addr))
      7 		return 1;
      8 	return 0;
      9 }