comparison Implab.Diagnostics.Interactive/InteractiveListener.cs @ 130:671f60cd0250 v2

fixed Resove method bug when calling it on already cancelled promise
author cin
date Fri, 30 Jan 2015 17:07:17 +0300
parents 4c0e5ef99986
children 04d4c92d0f28
comparison
equal deleted inserted replaced
129:471f596b2603 130:671f60cd0250
12 public class InteractiveListener: TextListenerBase 12 public class InteractiveListener: TextListenerBase
13 { 13 {
14 TraceForm m_form; 14 TraceForm m_form;
15 15
16 SynchronizationContext m_syncGuiThread; 16 SynchronizationContext m_syncGuiThread;
17 readonly Promise<object> m_guiStarted = new Promise<object>(); 17 readonly Promise m_guiStarted = new Promise();
18 18
19 readonly IPromise m_guiFinished; 19 readonly IPromise m_guiFinished;
20 // readonly IPromise m_workerFinished = new Promise<object>(); 20 // readonly IPromise m_workerFinished = new Promise<object>();
21 21
22 readonly MTQueue<TraceViewItem> m_queue = new MTQueue<TraceViewItem>(); 22 readonly MTQueue<TraceViewItem> m_queue = new MTQueue<TraceViewItem>();
28 readonly object m_pauseLock = new object(); 28 readonly object m_pauseLock = new object();
29 bool m_paused; 29 bool m_paused;
30 readonly ManualResetEvent m_pauseEvent = new ManualResetEvent(true); 30 readonly ManualResetEvent m_pauseEvent = new ManualResetEvent(true);
31 31
32 public InteractiveListener(bool global) : base(global) { 32 public InteractiveListener(bool global) : base(global) {
33 m_guiFinished = AsyncPool.InvokeNewThread(GuiThread); 33 m_guiFinished = AsyncPool.RunThread(GuiThread);
34 /*m_workerFinished = */AsyncPool.InvokeNewThread(QueueThread); 34 /*m_workerFinished = */AsyncPool.RunThread(QueueThread);
35 35
36 m_guiStarted.Join(); 36 m_guiStarted.Join();
37 } 37 }
38 38
39 void GuiThread() { 39 void GuiThread() {