protected WorkloadStatisticsBase(Guid groupguid, ZContext ctx, DataflowNetworkConstituent constituent, int boundedCapacity, CancellationToken ct) : this() { _constituent = constituent; _boundedCapacity = boundedCapacity; TaskGuid = Guid.NewGuid(); GroupGuid = groupguid; _workloadContextSender = new WorkloadContextSenderModel(ctx); ct.Register(() => _workloadContextSender.Dispose()); }
protected virtual void Dispose(bool disposing) { if (!_disposed) { // if this is a dispose call dispose on all state you // hold, and take yourself off the Finalization queue. if (disposing) { if (_workloadContextSender != null) { _workloadContextSender.Dispose(); _workloadContextSender = null; } } // free your own state (unmanaged code) AdditionalCleanup(); _disposed = true; } }