/// <summary> /// Enters the writer's lock. /// </summary> /// <returns>Disposable interface to enable using construct.</returns> /// <seealso cref="ReaderWriterLockSlim.EnterReadLock" /> internal bool TryLockWrite(out IDisposable locked) { locked = null; if (this.rwLock.TryEnterWriteLock(0)) { locked = new ActionDisposable(() => { }, () => this.rwLock.ExitWriteLock()); return(true); } return(false); }
internal bool TryLockWrite(out IDisposable locked) { locked = null; if([email protected](0)) { locked = new ActionDisposable(() => { }, () => [email protected]()); return true; } return false; }