public bool CompareAndSet(long expect, long update) { long rc = Interlocked.CompareExchange(ref value, update, expect); return rc == expect; } }