VirtThread.h 468 B

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