Exemplo n.º 1
0
        private void MarketProcessorThreadStatusChanged(object sender, MarketProcessorThreadStatusChangedEventArgs e)
        {
            if (e.status == MarketProcessorThreadStatus.CLOSED)
            {
                if (LigniteEngineThreads.ContainsKey(e.senderID))
                {
                    var senderId = e.senderID;
                    var thread = LigniteEngineThreads[senderId];

                    var beforeremove = LigniteEngineThreads.Count;
                    LigniteEngineThreads.Remove(senderId);

                    if (beforeremove <= LigniteEngineThreads.Count)
                    {
                        SendMessage("Thread " + senderId + " not removed from LigniteEngineThreads!");
                    }

                    if (thread.ThreadState == ThreadState.Running)
                    {
                        Thread.Sleep(5);
                        SendMessage("Thread " + senderId + " not terminated!");
                    }
                }
            }

            if (OnMarketProcessorThreadStatusChanged != null)
                OnMarketProcessorThreadStatusChanged(null, e);
        }
Exemplo n.º 2
0
 private void MarketProcessorThreadStatusChanged(object sender, MarketProcessorThreadStatusChangedEventArgs e)
 {
     try
     {
         if (e.senderID != null)
         {
             MasterEventController.InvokeDataProcessorMarketThreadStatusChanged(this, new DataProcessorMarketThreadStatusChangedEventArgs{SenderID = e.senderID, Status = e.status.ToString()});
         }
     }
     catch (Exception ex)
     {
         BroadcastMessage("---------------- Exception: Start----------------");
         BroadcastMessage(ex.Message);
         BroadcastMessage(ex.ToString());
         BroadcastMessage("---------------- Exception: End----------------");
     }
 }