Evo C++ Library v0.5.1
|
#include <evo/thread.h>
Creates a single thread of execution in given scope.
-pthread
-lpthread
C/C++ -> Code Generation -> Runtime Library
Public Types | |
typedef std::function< void(void *)> | Func |
Thread function type – with C++11 supports lambda/functor, otherwise just function pointer More... | |
typedef ThreadScope< Thread > | This |
Public Member Functions | |
ThreadScope (Thread::Func func, void *arg=NULL) | |
Constructor starts thread. More... | |
~ThreadScope () | |
Destructor joins thread. More... | |
bool | active () const |
Get whether thread is active (running). More... | |
bool | detach () |
Detach thread to run in background. More... | |
SysThread::Handle | handle () const |
Get platform-specific thread handle. More... | |
bool | join () |
Join thread by waiting for thread to stop. More... | |
bool | start () |
Start thread. More... | |
bool | thread_active () const |
Get whether thread is active (running). More... | |
virtual bool | thread_detach () |
Detach thread to run in background. More... | |
SysThread::Handle | thread_handle () const |
Get platform-specific thread handle. More... | |
bool | thread_join () |
Join thread by waiting for thread to stop. More... | |
bool | thread_start () |
Start thread. More... | |
Static Public Member Functions | |
static ulong | id () |
Get current thread ID from system. More... | |
static void | yield () |
Yield control to another thread or process. More... | |
Public Attributes | |
Init | thread_init |
Thread function pointer More... | |
Protected Attributes | |
bool | thread_active_ |
SysThread | thread_impl_ |
|
inherited |
Thread function type – with C++11 supports lambda/functor, otherwise just function pointer
typedef ThreadScope<Thread> This |
|
inline |
Constructor starts thread.
func | Thread function pointer |
arg | Argument to pass to thread function |
|
inline |
Destructor joins thread.
|
inline |
Get whether thread is active (running).
|
inline |
Detach thread to run in background.
|
inline |
Get platform-specific thread handle.
|
inlinestaticinherited |
Get current thread ID from system.
|
inline |
Join thread by waiting for thread to stop.
|
inline |
Start thread.
|
inlineinherited |
Get whether thread is active (running).
|
inlinevirtualinherited |
Detach thread to run in background.
|
inlineinherited |
Get platform-specific thread handle.
|
inlineinherited |
Join thread by waiting for thread to stop.
|
inlineinherited |
Start thread.
|
inlinestaticinherited |
Yield control to another thread or process.
|
protectedinherited |
|
protectedinherited |
|
inherited |
Thread function pointer