#include <Thread.h>
◆ ~Thread()
Frees any native handles.
◆ Thread() [1/2]
ehs::Thread::Thread |
( |
const UInt_64 | stackSize = 0 | ) |
|
Default members initialization.
◆ Thread() [2/2]
ehs::Thread::Thread |
( |
const Thread & | thread | ) |
|
Copies some members from the given thread object.
- Parameters
-
[in] | thread | The thread object to copy from. |
◆ Detach()
void ehs::Thread::Detach |
( |
| ) |
|
Detaches the referenced thread, removing ownership.
◆ GetCurrentId()
UInt_64 ehs::Thread::GetCurrentId |
( |
| ) |
|
|
static |
Retrieves the calling thread's id.
- Returns
- The id.
◆ GetHandle()
THandle ehs::Thread::GetHandle |
( |
| ) |
const |
Retrieves the native thread handle.
- Returns
- The native handle.
◆ GetId()
UInt_32 ehs::Thread::GetId |
( |
| ) |
const |
Retrieves the thread's id.
- Returns
- The id.
◆ GetMainId()
◆ GetStackSize()
UInt_64 ehs::Thread::GetStackSize |
( |
| ) |
const |
Retrieves the given stack size available to the referenced thread.
- Returns
- The stack size.
◆ HardSleepFor()
float ehs::Thread::HardSleepFor |
( |
const float | seconds | ) |
|
|
static |
Causes the calling thread to wait until the given time using a while loop and the CPU clock.
- Parameters
-
seconds | The time in seconds to wait for. |
- Returns
- The total elapsed time slept for due to this not being a 100% accurate.
- Warning
- Use "SleepFor" instead unless accuracy is required because this does not do other tasks while sleeping.
◆ IsCurrent()
bool ehs::Thread::IsCurrent |
( |
| ) |
const |
Checks whether or not the calling thread is the referenced thread.
- Returns
- The result.
◆ IsValid()
bool ehs::Thread::IsValid |
( |
| ) |
const |
◆ Join()
bool ehs::Thread::Join |
( |
const unsigned int | timeout = EHS_INFINITE | ) |
|
Blocks the calling thread until the referenced thread is finished.
- Parameters
-
timeout | The time to wait for before moving on. |
- Note
- Pass "EHS_INFINITE" to wait until the thread is finished.
◆ operator=()
Copies some members from the given thread object.
- Parameters
-
[in] | thread | The thread object to copy from. |
- Returns
- The thread that has been assigned to.
◆ SleepFor()
void ehs::Thread::SleepFor |
( |
const UInt_32 | miliseconds | ) |
|
|
static |
Causes the calling thread to wait until the given time using native sleep calls.
- Parameters
-
miliseconds | The time in miliseconds to wait for. |
- Warning
- This is not at all accurate.
◆ Start()
void ehs::Thread::Start |
( |
UInt_32(* | cb )(void *), |
|
|
void * | args ) |
Creates a thread handle and starts it with the given method.
- Parameters
-
cb | The function to run on the thread. |
args | Raw data to send over to the thread. |
The documentation for this class was generated from the following files: