Public Member Functions | |
PtThread (DWORD stackSize=4096) | |
| |
~PtThread (void) | |
| |
bool | Create (LPVOID arg=NULL) |
| |
bool | Run () |
Starts thread execution. | |
bool | Suspend () |
Suspends thread execution. | |
bool | Resume () |
Resumes thread execution. | |
bool | Kill (bool force=false, DWORD timeout=0) |
Finishing thread execution. | |
bool | Wait (DWORD dwMsec=-1) |
Waits for thread shutdown. | |
bool | GetExitCode (DWORD *code) |
Returns thread's exit code. | |
PtThreadState | GetState () |
Returns thread's state. | |
bool | IsRunning () |
Returns true if the thread executed now. | |
PtThreadID | ThreadId () |
Returns ID of the thread, controlled by the object. | |
Static Public Member Functions | |
static PtThreadID | CurrThreadId () |
Returns current executed thread ID. | |
static bool | ThreadIdsEqual (PtThreadID *p1, PtThreadID *p2) |
Compares two PtThreadID objects. | |
Protected Member Functions | |
bool | TestDestroy () |
Internal function to check the criteria to shutdown. | |
virtual DWORD | Entry (LPVOID arg) |
Thread payload. | |
Static Private Member Functions | |
static PtThreadFunc | EntryPoint (void *arg) |
PtThread::PtThread | ( | DWORD | stackSize = 4096 |
) |
Constructs PtThread object. Thread execution not started, even thread itself doesn't created. Only necessary structures are initialized.
stackSize | Stack size for the thread. |
PtThread::~PtThread | ( | void | ) |
Destroys object. If thread still running it will be force terminated
bool PtThread::Create | ( | LPVOID | arg = NULL |
) |
Creates thread in suspended mode, i.e execution will be paused until Run() function will be called.
arg | arguments that will be passed to thread function |
PtThreadID PtThread::CurrThreadId | ( | ) | [static] |
Returns current executed thread ID.
DWORD PtThread::Entry | ( | LPVOID | arg | ) | [protected, virtual] |
Thread payload.
Override this function to implement your threaded functionality.
Note: Doesn't call this function immediately from your program .
arg | arguments for thread passed to the Create() function |
Reimplemented in WpcAdapter::WpcAdapterInfo.
PtThreadFunc PtThread::EntryPoint | ( | void * | arg | ) | [static, private] |
This functions used to start thread. To implement your own functionality override Entry() method
bool PtThread::GetExitCode | ( | DWORD * | code | ) |
Returns thread's exit code.
PtThreadState PtThread::GetState | ( | ) | [inline] |
Returns thread's state.
bool PtThread::IsRunning | ( | ) | [inline] |
Returns true if the thread executed now.
bool PtThread::Kill | ( | bool | force = false , |
|
DWORD | timeout = 0 | |||
) |
Finishing thread execution.
force | if true, then thread will be force closed, even execution not finished yet | |
timeout | milliseconds to wait for thread gracefully shutdown |
bool PtThread::Resume | ( | ) |
Resumes thread execution.
bool PtThread::Run | ( | ) |
Starts thread execution.
bool PtThread::Suspend | ( | ) |
Suspends thread execution.
bool PtThread::TestDestroy | ( | ) | [protected] |
Internal function to check the criteria to shutdown.
PtThreadID PtThread::ThreadId | ( | ) | [inline] |
Returns ID of the thread, controlled by the object.
bool PtThread::ThreadIdsEqual | ( | PtThreadID * | p1, | |
PtThreadID * | p2 | |||
) | [static] |
Compares two PtThreadID objects.
bool PtThread::Wait | ( | DWORD | dwMsec = -1 |
) |
Waits for thread shutdown.
dwMsec | milliseconds to wait for thread gracefully shutdown |
©2009 Positive Technologies |
Generated on Fri May 22 18:17:01 2009 for wpcObj by |
|
1.5.7 |
|