![]() |
Open Lighting Architecture 0.10.9
|
A thread object that can be subclassed.
Classes | |
| struct | Options |
| Thread options. More... | |
Public Member Functions | |
| Thread (const Options &options=Options()) | |
| Create a new thread with the specified thread options. | |
| virtual | ~Thread () |
| Destructor. | |
| virtual bool | Start () |
| Start the thread and wait for the thread to be running. | |
| virtual bool | FastStart () |
| Start the thread and return immediately. | |
| virtual bool | Join (void *ptr=NULL) |
| Join this thread. | |
| bool | IsRunning () |
| Check if the thread is running. | |
| ThreadId | Id () const |
| Return the thread id. | |
| std::string | Name () const |
| Return the thread name. | |
Static Public Member Functions | |
| static ThreadId | Self () |
| Returns the current thread's id. | |
Protected Member Functions | |
| virtual void * | Run ()=0 |
| The entry point for the new thread. | |
Create a new thread with the specified thread options.
| options | the thread's options |
|
virtual |
Start the thread and return immediately.
Don't use this unless you know what you're doing, since it introduces a race condition with Join().
|
inline |
Return the thread id.
| bool ola::thread::Thread::IsRunning | ( | ) |
Check if the thread is running.
This is best-effort only, since the thread may stop after IsRunning() returns.
|
virtual |
Join this thread.
| [out] | ptr | The value returned from the thread. |
|
inline |
Return the thread name.
This may differ from the name assigned with pthread_setname, since the latter has a limit of 16 characters.
|
protectedpure virtual |
The entry point for the new thread.
Sub classes must implement this.
|
inlinestatic |
Returns the current thread's id.
|
virtual |
Start the thread and wait for the thread to be running.
This will block until the thread is running. Use FastStart() if you don't want to block.