diff options
Diffstat (limited to 'CPP/Windows/Thread.h')
-rwxr-xr-x | CPP/Windows/Thread.h | 3 |
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)); } |