Exemple #1
0
        private void OnLogRecordArrived(BufferPool bufferPool)
        {
            using (var reader = new BinaryReader(new BufferPoolStream(bufferPool)))
            {
                var record = LogRecord.ReadFrom(reader);
                switch (record.RecordType)
                {
                case LogRecordType.Prepare:
                {
                    WritePrepareWithRetry((PrepareLogRecord)record);
                    break;
                }

                case LogRecordType.Commit:
                {
                    WriteCommitWithRetry((CommitLogRecord)record);
                    break;
                }

                default:
                    throw new ArgumentOutOfRangeException();
                }
                bufferPool.Dispose();
            }
        }
Exemple #2
0
        public void Dispose()
        {
            disposerLock.EnterWriteLock();
            try
            {
                if (disposed)
                {
                    return;
                }
                disposed = true;
                current.Dispose();

                if (tableStorage != null)
                {
                    tableStorage.Dispose();
                }

                if (bufferPool != null)
                {
                    bufferPool.Dispose();
                }
            }
            finally
            {
                disposerLock.ExitWriteLock();
            }
        }
Exemple #3
0
 public void Dispose()
 {
     _ephemeralKeysPool?.Dispose();
     _ephemeralKeysPool = null;
     _ephemeralSessionPool?.Dispose();
     _ephemeralSessionPool = null;
     GC.SuppressFinalize(this);
 }
Exemple #4
0
 protected override void Free()
 {
     Stop();
     if (_bufferPool != null)
     {
         _bufferPool.Dispose();
     }
 }
Exemple #5
0
            public void Dispose()
            {
                if (IsTemporary)
                {
                    BufferPoolAllocation.Dispose();
                }

                Data = null;
            }
Exemple #6
0
        /// <summary>
        ///     Dispose the Proxy instance.
        /// </summary>
        public void Dispose()
        {
            if (ProxyRunning)
            {
                Stop();
            }

            CertificateManager?.Dispose();
            BufferPool?.Dispose();
        }
        public void Dispose()
        {
            _transport.Input.Complete();
            _transport.Output.Complete();

            _application.Input.Complete();
            _application.Output.Complete();

            _pipelineFactory.Dispose();
        }
        public void Dispose()
        {
            AppDomain.CurrentDomain.ProcessExit  -= ShouldDispose;
            AppDomain.CurrentDomain.DomainUnload -= ShouldDispose;

            storage.Dispose();
            search.Dispose();
            sigGenerator.Dispose();
            BufferPool.Dispose();
            metricsCounters.Dispose();
        }
 protected override void Dispose(bool disposing)
 {
     if (Queue != null)
     {
         Queue.Dispose();
     }
     if (MemoryPool != null)
     {
         MemoryPool.Dispose();
     }
 }
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         m_callbacks = null;
         if (m_videoQueue != null)
         {
             m_videoQueue.Dispose();
         }
         if (m_videoPool != null)
         {
             m_videoPool.Dispose();
         }
     }
 }
Exemple #11
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            AppDomain.CurrentDomain.ProcessExit  -= ShouldDispose;
            AppDomain.CurrentDomain.DomainUnload -= ShouldDispose;

            disposed = true;

            synchronizationTask.Dispose();
            storage.Dispose();
            search.Dispose();
            sigGenerator.Dispose();
            BufferPool.Dispose();
            metricsCounters.Dispose();
        }
    protected virtual void Dispose(bool disposing)
    {
        if (_disposed)
        {
            return;
        }

        if (disposing)
        {
        }

        if (_handle != null)
        {
            if (
                !_handle.IsInvalid &&
                !_handle.IsClosed
                )
            {
                _logger.LogInformation("[wave] stop");
                Reset();

                //バッファの開放待ち
                _logger.LogInformation($"[wave] wait busy buffers :{_headerBusyPool.Count}");
                while (_headerBusyPool.Count > 0)
                {
                    Thread.Sleep(1000);
                    _logger.LogInformation($"[wave] wait busy buffers :{_headerBusyPool.Count}");
                }
                _logger.LogInformation($"[wave] wait end :{_headerBusyPool.Count}");

                _releaseAction.Complete();
                _releaseAction.Completion.Wait();

                _handle.Close();
            }
        }

        _headerPool?.Dispose();
        _driverCallBack?.Dispose();

        _disposed = true;
    }
Exemple #13
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     bufferPool.Dispose();
 }
 public void Dispose()
 {
     _bufferPool.Dispose();
 }
 public void Dispose()
 {
     Buffer.Dispose();
 }
        private void ThreadStart(object parameter)
        {
            lock (_startSync)
            {
                var tcs = (TaskCompletionSource <int>)parameter;
                try
                {
                    _loop.Init(_transport.Libuv);
                    _post.Init(_loop, OnPost, EnqueueCloseHandle);
                    _initCompleted = true;
                    tcs.SetResult(0);
                }
                catch (Exception ex)
                {
                    tcs.SetException(ex);
                    return;
                }
            }

            try
            {
                _loop.Run();
                if (_stopImmediate)
                {
                    // thread-abort form of exit, resources will be leaked
                    return;
                }

                // run the loop one more time to delete the open handles
                _post.Reference();
                _post.Dispose();

                // We need this walk because we call ReadStop on on accepted connections when there's back pressure
                // Calling ReadStop makes the handle as in-active which means the loop can
                // end while there's still valid handles around. This makes loop.Dispose throw
                // with an EBUSY. To avoid that, we walk all of the handles and dispose them.
                Walk(ptr =>
                {
                    var handle = UvMemory.FromIntPtr <UvHandle>(ptr);
                    // handle can be null because UvMemory.FromIntPtr looks up a weak reference
                    handle?.Dispose();
                });

                // Ensure the Dispose operations complete in the event loop.
                _loop.Run();

                _loop.Dispose();
            }
            catch (Exception ex)
            {
                _closeError = ExceptionDispatchInfo.Capture(ex);
                // Request shutdown so we can rethrow this exception
                // in Stop which should be observable.
                _appLifetime.StopApplication();
            }
            finally
            {
                BufferPool.Dispose();
                WriteReqPool.Dispose();
                _threadTcs.SetResult(null);

#if DEBUG
                // Check for handle leaks after disposing everything
                CheckUvReqLeaks();
#endif
            }
        }
 public void Dispose()
 {
     _libuvThread.StopAsync(TimeSpan.FromSeconds(1)).Wait();
     _bufferPool.Dispose();
 }
Exemple #18
0
 public override void Setup()
 {
     base.Setup();
     m_DisposedPool = new BufferPool(10, BufferManager);
     m_DisposedPool.Dispose();
 }
Exemple #19
0
 public void Dispose() => _pool.Dispose();
 public override void Setup()
 {
     base.Setup();
     m_DisposedPool = new BufferPool(10, BufferManager);
     m_DisposedPool.Dispose();
 }
 public Task StopAsync()
 {
     _bufferPool.Dispose();
     return(Task.CompletedTask);
 }