shithub: drawcpu

ref: 8b24f795e2bb2a5d169641ed0fda0e99b69e4466
dir: /cas.c/

View raw version
#include "u.h"
#include "libc.h"

int
cas(int *x, int old, int new)
{
	return __atomic_compare_exchange_n(x, &old, new, 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
}