/// <summary>
 /// Stop the real time thread
 /// </summary>
 public void Exit()
 {
     _timeMonitor.DisposeSafely();
     _timeMonitor = null;
     _realTimeThread.StopSafely(TimeSpan.FromMinutes(5), _cancellationTokenSource);
     _realTimeThread = null;
 }
Пример #2
0
        /// <summary>
        /// Stop the real time thread
        /// </summary>
        public void Exit()
        {
            _timeMonitor.DisposeSafely();
            _timeMonitor = null;
            if (_realTimeThread != null)
            {
                _cancellationTokenSource.Cancel();
                try
                {
                    if (!_realTimeThread.Join(TimeSpan.FromMinutes(5)))
                    {
                        Log.Error("LiveTradingRealTimeHandler.Exit(): Timeout waiting for update thread to stop");
                        _realTimeThread.Abort();
                    }
                }
                catch (Exception exception)
                {
                    // just in case catch any exceptions thrown
                    Log.Error(exception);
                }

                _realTimeThread = null;
            }
        }
 /// <summary>
 /// Stop the real time thread
 /// </summary>
 public void Exit()
 {
     _timeMonitor.DisposeSafely();
     _timeMonitor = null;
 }