1 // VirtThread.h
2 
3 #ifndef __VIRTTHREAD_H
4 #define __VIRTTHREAD_H
5 
6 #include "../../Windows/Synchronization.h"
7 #include "../../Windows/Thread.h"
8 
9 struct CVirtThread
10 {
11   NWindows::NSynchronization::CAutoResetEvent StartEvent;
12   NWindows::NSynchronization::CAutoResetEvent FinishedEvent;
13   NWindows::CThread Thread;
14   bool ExitEvent;
15 
16   ~CVirtThread();
17   WRes Create();
18   void Start();
WaitFinishCVirtThread19   void WaitFinish() { FinishedEvent.Lock(); }
20   virtual void Execute() = 0;
21 };
22 
23 #endif
24