summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/Common/VirtThread.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lzma/CPP/7zip/Common/VirtThread.h')
-rw-r--r--3rdparty/lzma/CPP/7zip/Common/VirtThread.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/3rdparty/lzma/CPP/7zip/Common/VirtThread.h b/3rdparty/lzma/CPP/7zip/Common/VirtThread.h
new file mode 100644
index 00000000000..ebee158ca5b
--- /dev/null
+++ b/3rdparty/lzma/CPP/7zip/Common/VirtThread.h
@@ -0,0 +1,24 @@
+// VirtThread.h
+
+#ifndef __VIRT_THREAD_H
+#define __VIRT_THREAD_H
+
+#include "../../Windows/Synchronization.h"
+#include "../../Windows/Thread.h"
+
+struct CVirtThread
+{
+ NWindows::NSynchronization::CAutoResetEvent StartEvent;
+ NWindows::NSynchronization::CAutoResetEvent FinishedEvent;
+ NWindows::CThread Thread;
+ bool Exit;
+
+ ~CVirtThread() { WaitThreadFinish(); }
+ void WaitThreadFinish(); // call it in destructor of child class !
+ WRes Create();
+ void Start();
+ virtual void Execute() = 0;
+ void WaitExecuteFinish() { FinishedEvent.Lock(); }
+};
+
+#endif