コード例 #1
0
        /// <summary>
        /// Not expected to be called concurrently with TryAdd().
        /// </summary>
        public void Dispose()
        {
            TryFlushAsync().GetAwaiter().GetResult();

            workerCancellation.Cancel();

            WaitForWorkerCompletion();

            SignalFlushWaiters(DrainFlushWaiters(), false);

            workerCancellation.Dispose();

            writerProvider.Dispose();
        }
コード例 #2
0
        public void Dispose()
        {
            if (writerProvider == null)
            {
                return;
            }

            workerCancellation.Cancel();

            lock (sync)
            {
                writerProvider.Dispose();
                writerProvider = null;
                workerCancellation.Dispose();
            }
        }