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