mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 22:24:08 -06:00
4.20
This commit is contained in:
committed by
Kornel Lesiński
parent
8c1b5c7b7e
commit
3c510ba80b
+9
-2
@@ -1,7 +1,5 @@
|
||||
// Windows/Thread.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __WINDOWS_THREAD_H
|
||||
#define __WINDOWS_THREAD_H
|
||||
|
||||
@@ -12,6 +10,7 @@ namespace NWindows {
|
||||
|
||||
class CThread: public CHandle
|
||||
{
|
||||
bool IsOpen() const { return _handle != 0; }
|
||||
public:
|
||||
bool Create(LPSECURITY_ATTRIBUTES threadAttributes,
|
||||
SIZE_T stackSize, LPTHREAD_START_ROUTINE startAddress,
|
||||
@@ -38,6 +37,14 @@ public:
|
||||
{ return ::GetThreadPriority(_handle); }
|
||||
bool SetPriority(int priority)
|
||||
{ return BOOLToBool(::SetThreadPriority(_handle, priority)); }
|
||||
|
||||
bool Wait()
|
||||
{
|
||||
if (!IsOpen())
|
||||
return true;
|
||||
return (::WaitForSingleObject(_handle, INFINITE) == WAIT_OBJECT_0);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user