Thread Class Reference
Thread convenience wrapper.
More...
List of all members.
Public Types |
enum | { LOW_PRIORITY = 20,
NORMAL_PRIORITY = 0
} |
enum | { LOW_PRIORITY = 20,
NORMAL_PRIORITY = 0
} |
Public Member Functions |
void | Detach () |
| Detaches a thread -- the thread will cease to exist once the task completes.
|
void | Detach () |
| Detaches a thread -- the thread will cease to exist once the task completes.
|
void | Init (Task *task_in) |
| Initializes, given a task to run.
|
void | Init (Task *task_in) |
| Initializes, given a task to run.
|
void | Start (int prio) |
| Starts the thread running with specified priority.
|
void | Start () |
| Starts the thread running.
|
void | Start (int prio) |
| Starts the thread running with specified priority.
|
void | Start () |
| Starts the thread running.
|
Task * | task () const |
| Gets the contained task.
|
Task * | task () const |
| Gets the contained task.
|
void | WaitStop () |
| Wait for a thread to stop.
|
void | WaitStop () |
| Wait for a thread to stop.
|
Detailed Description
Thread convenience wrapper.
Usage: Create a Thread, give it a Task object, tell the thread to run, and eventually wait for the thread to finish.
Definition at line 53 of file thread.h.
Member Function Documentation
void Thread::Detach |
( |
|
) |
[inline] |
Detaches a thread -- the thread will cease to exist once the task completes.
You may not call WaitStop on this thread afterwards.
Definition at line 152 of file thread.h.
void Thread::Detach |
( |
|
) |
[inline] |
Detaches a thread -- the thread will cease to exist once the task completes.
You may not call WaitStop on this thread afterwards.
Definition at line 152 of file thread.h.
void Thread::Init |
( |
Task * |
task_in |
) |
[inline] |
Initializes, given a task to run.
Definition at line 97 of file thread.h.
void Thread::Init |
( |
Task * |
task_in |
) |
[inline] |
Initializes, given a task to run.
Definition at line 97 of file thread.h.
void Thread::Start |
( |
int |
prio |
) |
[inline] |
Starts the thread running with specified priority.
The priority number is backwards from priority -- higher numbers have less priority. Use a priority of 20 for the lowest possible priority, or 0 if you don't want to change the priority. Sorry, it is not possible to increase your priority.
Definition at line 129 of file thread.h.
void Thread::Start |
( |
|
) |
[inline] |
Starts the thread running.
Definition at line 110 of file thread.h.
void Thread::Start |
( |
int |
prio |
) |
[inline] |
Starts the thread running with specified priority.
The priority number is backwards from priority -- higher numbers have less priority. Use a priority of 20 for the lowest possible priority, or 0 if you don't want to change the priority. Sorry, it is not possible to increase your priority.
Definition at line 129 of file thread.h.
void Thread::Start |
( |
|
) |
[inline] |
Starts the thread running.
Definition at line 110 of file thread.h.
Task* Thread::task |
( |
|
) |
const [inline] |
Gets the contained task.
Definition at line 180 of file thread.h.
Task* Thread::task |
( |
|
) |
const [inline] |
Gets the contained task.
Definition at line 180 of file thread.h.
void Thread::WaitStop |
( |
|
) |
[inline] |
Wait for a thread to stop.
Failure to do this may cause your program to hang when it is done.
Definition at line 167 of file thread.h.
void Thread::WaitStop |
( |
|
) |
[inline] |
Wait for a thread to stop.
Failure to do this may cause your program to hang when it is done.
Definition at line 167 of file thread.h.
The documentation for this class was generated from the following files: