Пример #1
0
            /// <inheritdoc />
            public void Dispose()
            {
                if (_isDisposed)
                {
                    return;
                }
                _isDisposed = true;

                if (_operation == LockHolderType.Read)
                {
                    _parent.ReleaseReaderLock();
                }
                else
                {
                    _parent.ReleaseWriterLock();
                }
            }
            /// <summary>
            /// Releases unmanaged and - optionally - managed resources.
            /// </summary>
            /// <param name="alsoManaged"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
            private void Dispose(bool alsoManaged)
            {
                if (IsDisposed)
                {
                    return;
                }
                IsDisposed = true;

                if (Operation == LockHolderType.Read)
                {
                    Parent.ReleaseReaderLock();
                }
                else
                {
                    Parent.ReleaseWriterLock();
                }
            }