Class that implements a wrapper for a pthread thread. More...
#include <SPL/Runtime/Utility/Thread.h>
Class that implements a wrapper for a pthread thread.
int SPL::Thread::create |
( |
pthread_attr_t * |
attr = NULL , |
|
|
bool |
detached = false , |
|
|
void * |
args = NULL , |
|
|
bool |
waitStart = false , |
|
|
size_t |
stackSize = 0 , |
|
|
pthread_t * |
id = NULL |
|
) |
|
|
|
inline |
Create a thread
- Parameters
-
attr |
the attributes used by pthread_create |
detached |
create thread in detached state |
args |
the arguments passed to the thread |
waitStart |
wait until the thread has started |
stackSize |
thread stack size (uses pthread default if 0) |
id |
thread id representing this thread |
- Returns
- return value from the
pthread_create
call
int SPL::Thread::join |
( |
void * |
status = NULL |
) |
|
|
inline |
Join a thread
- Parameters
-
status |
returns the value returned by a thread once it finishes |
void SPL::Thread::detach |
( |
|
) |
|
|
inline |
void SPL::Thread::kill |
( |
int |
sig = 9 |
) |
|
|
inline |
Send a signal to a thread
- Parameters
-
sig |
signal to send (see kill(1) for the possible signal values) |
void SPL::Thread::cancel |
( |
|
) |
|
|
inline |
void SPL::Thread::enableCancel |
( |
int |
type |
) |
|
|
inline |
Turn on cancel
- Parameters
-
void SPL::Thread::disableCancel |
( |
|
) |
|
|
inline |
virtual void* SPL::Thread::run |
( |
void * |
args |
) |
|
|
pure virtual |
Execute the task a thread is supposed to do. This method is customized by someone writing the code that is supposed to be executed as a thread
- Parameters
-
args |
the arguments received by a thread |
virtual pthread_t SPL::Thread::getPThreadId |
( |
|
) |
const |
|
inlinevirtual |
Obtain the thread id
- Returns
- the thread id for the thread
void SPL::Thread::registerThread |
( |
const std::string & |
name |
) |
|
Register the thread with the PE.
- Parameters
-
name |
the name to provide to the OS for the thread |
The documentation for this class was generated from the following file: