src/Azos/Platform/ManyReadersOneWriterSynchronizer.cs
/// <summary>
/// Tries to obtain the write lock returning true on success, false if lock could not be taken -
/// either someone reads or writes. Only one thread may hold a write lock at a time
/// </summary>
Tries to obtain the write lock returning true on success, false if lock could not be taken
either someone reads or writes. Only one thread may hold a write lock at a time
Tries to obtain the write lock returning true on success false if lock could not be taken either someone reads or writes . Only one thread may hold a write lock at a time
public bool TryGetWriteLock()
      {
        long current = Interlocked.CompareExchange(ref m_Readers, long.MinValue, 0);
        return current==0;
      }
public bool TryGetWriteLock ( ) { long current = Interlocked . CompareExchange ( ref m_Readers , long . MinValue , 0 ) ; return current == 0 ; }
Tries to obtain the write lock returning true on success, false if lock could not be taken
either someone reads or writes.
Tries to obtain the write lock returning true on success false if lock could not be taken either someone reads or writes .
//the lock succeeded