Exemple #1
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            _disposed = true;

            if (disposing)
            {
                if (_existManager != null)
                {
                    try
                    {
                        _existManager.Dispose();
                    }
                    catch (Exception)
                    {
                    }

                    _existManager = null;
                }

                _setKeys.Dispose();
                _removeKeys.Dispose();

                _setThread.Join();
                _removeThread.Join();
            }
        }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            _disposed = true;

            if (disposing)
            {
                _uploadedKeys.Dispose();

                _uploadedThread.Join();
            }
        }
Exemple #3
0
            protected override void Dispose(bool disposing)
            {
                try
                {
                    if (_disposed)
                    {
                        return;
                    }
                    _disposed = true;

                    if (disposing)
                    {
                        _queue.Dispose();

                        if (_watchThread != null)
                        {
                            try
                            {
                                _watchThread.Join();
                            }
                            catch (Exception)
                            {
                            }

                            _watchThread = null;
                        }

                        if (_stream != null)
                        {
                            try
                            {
                                _stream.Dispose();
                            }
                            catch (Exception)
                            {
                            }

                            _stream = null;
                        }
                    }
                }
                finally
                {
                    base.Dispose(disposing);
                }
            }
        public void Dispose()
        {
            if (_state.TryChange(State.Disposed))
            {
                if (_closingEventHandler != null)
                {
                    _closingEventHandler(new ConnectionPoolClosingEvent(_serverId));
                }

                _connectionHolder.Clear();
                _maintenanceCancellationTokenSource.Cancel();
                _maintenanceCancellationTokenSource.Dispose();
                _poolQueue.Dispose();
                _waitQueue.Dispose();
                _connectingQueue.Dispose();
                if (_closedEventHandler != null)
                {
                    _closedEventHandler(new ConnectionPoolClosedEvent(_serverId));
                }
            }
        }