DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="3.2.0" />

 ReaderWriterSpinLock

public struct ReaderWriterSpinLock
public struct LockStamp : IEquatable<LockStamp>

public int CurrentReadCount { get; }

public bool IsReadLockHeld { get; }

public bool IsWriteLockHeld { get; }

public void EnterReadLock()

public void EnterWriteLock()

public void ExitReadLock()

public void ExitWriteLock()

public bool TryEnterReadLock()

public bool TryEnterReadLock(TimeSpan timeout, CancellationToken token = default)

public bool TryEnterWriteLock()

public bool TryEnterWriteLock(TimeSpan timeout, CancellationToken token = default)

public bool Validate(ref LockStamp stamp)