This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions
+9 -2
View File
@@ -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);
}
};
}