/// <summary> /// Validate a stamp from <seealso cref="tryOptimisticReadLock(long)"/> or <seealso cref="unlockExclusive(long)"/>, and return /// {@code true} if no write or exclusive lock overlapped with the critical section of the optimistic read lock /// represented by the stamp. /// </summary> /// <param name="stamp"> The stamp of the optimistic read lock. </param> /// <returns> {@code true} if the optimistic read lock was valid, {@code false} otherwise. </returns> public static bool ValidateReadLock(long address, long stamp) { UnsafeUtil.loadFence(); return((GetState(address) & _chkMask) == stamp); }