Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Windows/Thread.h')
-rwxr-xr-xCPP/Windows/Thread.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/CPP/Windows/Thread.h b/CPP/Windows/Thread.h
index 9c427608..39104f4a 100755
--- a/CPP/Windows/Thread.h
+++ b/CPP/Windows/Thread.h
@@ -25,6 +25,9 @@ public:
WRes Wait() { return Thread_Wait(&thread); }
#ifdef _WIN32
+ operator HANDLE() { return thread.handle; }
+ void Attach(HANDLE handle) { thread.handle = handle; }
+ HANDLE Detach() { HANDLE h = thread.handle; thread.handle = NULL; return h; }
DWORD Resume() { return ::ResumeThread(thread.handle); }
DWORD Suspend() { return ::SuspendThread(thread.handle); }
bool Terminate(DWORD exitCode) { return BOOLToBool(::TerminateThread(thread.handle, exitCode)); }