Inheritance: IDisposable
コード例 #1
0
 public CompositionLock(bool isThreadSafe)
 {
     this._isThreadSafe = isThreadSafe;
     if (isThreadSafe)
     {
         this._stateLock = new Lock();
     }
 }
コード例 #2
0
ファイル: PackageCatalog.cs プロジェクト: lucaslra/SPM
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing)
                {
                    Lock disposeLock = null;

                    if (!this._isDisposed)
                    {
                        using (new WriteLock(this._lock))
                        {
                            if (!this._isDisposed)
                            {
                                this._isDisposed = true;
                                disposeLock = this._lock;
                                this._lock = null;
                                this._packages = null;
                                this._loadedAssemblies = null;
                                this._parts = null;
                                this._partsQuery = null;
                            }
                        }
                    }

                    if (disposeLock != null)
                    {
                        disposeLock.Dispose();
                    }
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }
コード例 #3
0
 public ReadLock(Lock @lock)
 {
     this._isDisposed = 0;
     this._lock       = @lock;
     this._lock.EnterReadLock();
 }