AbstractQueuedSynchronizer.compareAndSetState

Atomically sets synchronization state to the given updated value if the current state value equals the expected value. This operation has memory semantics of a {@code volatile} read and write.

@param expect the expected value @param update the new value @return {@code true} if successful. False return indicates that the actual value was not equal to the expected value.

class AbstractQueuedSynchronizer
protected final
bool
compareAndSetState
(
int expect
,
int update
)

Meta