public DisposableItem() { _privateReadOnlyDisposableField = new Mutex(); _doNotDispose = new Mutex(); DisposableReadOnlyAutoProperty = new NonRecursiveLock(); DoNotDisposeAutoProperty = new NonRecursiveLock(); }
protected override void TeardownTestMethod() { ReleaseWriteLock(); ReleaseUpgradeableLock(); ReleaseReadLock(); _teardownThread = true; Thread.Sleep(TimeSpan.FromSeconds(1)); if (_threads != null) { foreach (var t in _threads) { t?.Join(); } _threads = null; } if (_target.IsNotNull()) { _target.Dispose(); _target = null; } }
protected override void TeardownTestMethod() { if (_target.IsNotNull()) { _target.Dispose(); _target = null; } }
protected override void ActMethod() { _target = new NonRecursiveLock(); }
protected override void ArrangeMethod() { _threads = new ConcurrentBag <Thread>(); _target = new NonRecursiveLock(); }