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