public void Dispose()
 {
     if (!_dispose)
     {
         _dispose = true;
         _cancellation.Cancel();
         _delapyer.Dispose();
         //task不需要手工回收
     }
 }
Exemplo n.º 2
0
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;
            _lock.Write(() =>
            {
                DisposeOverage();
                _stomach.Dispose();
                _enzyme.Dispose();
                _delapyer.Dispose();
                OnDispose();
            });
            _lock.Dispose();
        }