#include <thread.h>
Public Member Functions | |
DEFINE_CLASS_POINTERS (Thread) | |
void | Join () |
Wait until started thread stop. | |
void | Run () |
Calls in the separate thread from ThreadProc. | |
Thread (std::function< void()> f, ThreadObserver *observer=0) | |
Starts f in a separate thread. | |
~Thread () | |
Static Public Member Functions | |
static Thread::UniquePtr | Create (ThreadProc f, ThreadObserver *observer=0) |
static Thread::UniquePtr | Create (void(*f)(), ThreadObserver *observer=0) |
static void | ThreadProc (Thread *thread) |
static member required for std::thread | |
Private Attributes | |
Common::ThreadProc | Func |
std::thread | Impl |
ThreadObserver * | Observer |
Common::Thread::Thread | ( | std::function< void()> | f, |
ThreadObserver * | observer = 0 |
||
) |
Starts f in a separate thread.
Definition at line 18 of file thread.cpp.
Definition at line 25 of file thread.cpp.
static Thread::UniquePtr Common::Thread::Create | ( | ThreadProc | f, |
ThreadObserver * | observer = 0 |
||
) | [inline, static] |
static Thread::UniquePtr Common::Thread::Create | ( | void(*)() | f, |
ThreadObserver * | observer = 0 |
||
) | [inline, static] |
void Common::Thread::Join | ( | ) |
Wait until started thread stop.
Definition at line 36 of file thread.cpp.
void Common::Thread::Run | ( | ) |
Calls in the separate thread from ThreadProc.
Definition at line 41 of file thread.cpp.
void Common::Thread::ThreadProc | ( | Thread * | thread | ) | [static] |
static member required for std::thread
Definition at line 60 of file thread.cpp.
Common::ThreadProc Common::Thread::Func [private] |
std::thread Common::Thread::Impl [private] |
ThreadObserver* Common::Thread::Observer [private] |