private void Dispose(bool disposeManagedResources) { if (disposeManagedResources) { if (Interlocked.CompareExchange(ref _disposing, 1, 0) == 0) { _wrapped.Dispose(); _wrapped = null; } } }
private void Dispose(bool disposeManagedResources) { if (!disposeManagedResources) { return; } if (Interlocked.CompareExchange(ref _disposing, 1, 0) != 0) { return; } _wrapped?.Dispose(); _wrapped = null; }
public void Dispose() { _threadLocal.Dispose(); _dispatchesPerStmtTl.Dispose(); }