summaryrefslogtreecommitdiffstats
path: root/CPP/7zip/Common/VirtThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Common/VirtThread.h')
-rwxr-xr-xCPP/7zip/Common/VirtThread.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/CPP/7zip/Common/VirtThread.h b/CPP/7zip/Common/VirtThread.h
new file mode 100755
index 0000000..bfc10dc
--- /dev/null
+++ b/CPP/7zip/Common/VirtThread.h
@@ -0,0 +1,23 @@
+// VirtThread.h
+
+#ifndef __VIRTTHREAD_H
+#define __VIRTTHREAD_H
+
+#include "../../Windows/Synchronization.h"
+#include "../../Windows/Thread.h"
+
+struct CVirtThread
+{
+ NWindows::NSynchronization::CAutoResetEvent StartEvent;
+ NWindows::NSynchronization::CAutoResetEvent FinishedEvent;
+ NWindows::CThread Thread;
+ bool ExitEvent;
+
+ ~CVirtThread();
+ WRes Create();
+ void Start();
+ void WaitFinish() { FinishedEvent.Lock(); }
+ virtual void Execute() = 0;
+};
+
+#endif