Sirikata
|
Thread is a thin wrapper around boost::thread which handles common thread initialization processes. More...
#include <Thread.hpp>
Public Types | |
typedef std::tr1::function< void()> | ThreadMainFunc |
Public Member Functions | |
Thread () | |
~Thread () | |
Thread (String name, ThreadMainFunc f) | |
boost::thread::id | get_id () const |
bool | joinable () const |
void | join () |
bool | timed_join (const boost::system_time &wait_until) |
template<typename TimeDuration > | |
bool | timed_join (TimeDuration const &rel_time) |
void | detach () |
void | interrupt () |
bool | interruption_requested () const |
Static Public Member Functions | |
static unsigned | hardware_concurrency () |
static void | yield () |
static void | sleep (const boost::system_time &xt) |
Private Member Functions | |
void | initThread (String name, ThreadMainFunc f) |
Thread (Thread &rhs) | |
Private Attributes | |
boost::thread | mImpl |
Thread is a thin wrapper around boost::thread which handles common thread initialization processes.
It is not intended to hide boost::thread, but rather handle things like setting the thread up for profiling and crash handling.
typedef std::tr1::function<void()> Sirikata::Thread::ThreadMainFunc |
Sirikata::Thread::Thread | ( | ) | [inline] |
Sirikata::Thread::~Thread | ( | ) | [inline] |
Sirikata::Thread::Thread | ( | String | name, |
ThreadMainFunc | f | ||
) | [inline, explicit] |
Sirikata::Thread::Thread | ( | Thread & | rhs | ) | [private] |
void Sirikata::Thread::detach | ( | ) | [inline] |
References mImpl.
boost::thread::id Sirikata::Thread::get_id | ( | ) | const [inline] |
References mImpl.
static unsigned Sirikata::Thread::hardware_concurrency | ( | ) | [inline, static] |
void Sirikata::Thread::initThread | ( | String | name, |
ThreadMainFunc | f | ||
) | [inline, private] |
void Sirikata::Thread::interrupt | ( | ) | [inline] |
References mImpl.
bool Sirikata::Thread::interruption_requested | ( | ) | const [inline] |
References mImpl.
void Sirikata::Thread::join | ( | ) | [inline] |
References mImpl.
Referenced by Sirikata::Trace::Trace::shutdown(), Sirikata::OH::SQLiteStorage::stop(), Sirikata::OH::SQLitePersistedObjectSet::stop(), Sirikata::OH::CassandraStorage::stop(), Sirikata::OH::CassandraPersistedObjectSet::stop(), Sirikata::NTPTimeSync::stop(), Sirikata::AggregateManager::~AggregateManager(), Sirikata::JS::JSObjectScriptManager::~JSObjectScriptManager(), and Sirikata::Graphics::OgreRenderer::~OgreRenderer().
bool Sirikata::Thread::joinable | ( | ) | const [inline] |
References mImpl.
static void Sirikata::Thread::sleep | ( | const boost::system_time & | xt | ) | [inline, static] |
bool Sirikata::Thread::timed_join | ( | const boost::system_time & | wait_until | ) | [inline] |
References mImpl.
bool Sirikata::Thread::timed_join | ( | TimeDuration const & | rel_time | ) | [inline] |
References mImpl.
static void Sirikata::Thread::yield | ( | ) | [inline, static] |
boost::thread Sirikata::Thread::mImpl [private] |
Referenced by detach(), get_id(), interrupt(), interruption_requested(), join(), joinable(), and timed_join().