library of assembled shared sources |
http://lass.cocamware.com |
#include <thread.h>
Public Types | |
enum | { anyProcessor = unsigned(-1) } |
Public Member Functions | |
virtual | ~Thread () |
void | run () |
void | join () |
void | bind (unsigned processor) |
bind this thread to a processor (this as in this-pointer) | |
Static Public Member Functions | |
static void | sleep (unsigned long milliseconds) |
static void | yield () |
static void | bindCurrent (unsigned processor) |
bind current thread to a processor (current as in callee's context) | |
Protected Member Functions | |
Thread (ThreadKind kind=threadDetached, const char *name=0) | |
Private Member Functions | |
virtual void | doRun ()=0 |
void | swap (NonCopyable &) |
Private Attributes | |
impl::ThreadInternal * | pimpl_ |
Friends | |
class | impl::ThreadInternal |
The virtual function doRun() needs to be overriden and after creation of the thread on the heap or stack, the thread is in a state ready to be run. The run() function actually starts the thread.
JOINABLE threads can be waited for, DETACHED threads can not be waited for.
Definition at line 191 of file thread.h.
anonymous enum |
anyProcessor | argument for Thread::bind to unbind the thread so it runs on any processor |
lass::util::Thread::~Thread | ( | ) | [virtual] |
lass::util::Thread::Thread | ( | ThreadKind | kind = threadDetached , |
|
const char * | name = 0 | |||
) | [protected] |
void lass::util::Thread::run | ( | ) |
Definition at line 214 of file thread.cpp.
References LASS_ASSERT, pimpl_, and lass::util::impl::ThreadInternal::run().
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::startThreads().
void lass::util::Thread::join | ( | ) |
Definition at line 220 of file thread.cpp.
References lass::util::impl::ThreadInternal::join(), LASS_ASSERT, and pimpl_.
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::stopThreads().
void lass::util::Thread::bind | ( | unsigned | processor | ) |
bind this thread to a processor (this as in this-pointer)
Definition at line 228 of file thread.cpp.
References lass::util::impl::ThreadInternal::bind(), LASS_ASSERT, and pimpl_.
Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::startThreads().
void lass::util::Thread::sleep | ( | unsigned long | milliseconds | ) | [static] |
Definition at line 234 of file thread.cpp.
void lass::util::Thread::yield | ( | ) | [static] |
Definition at line 239 of file thread.cpp.
void lass::util::Thread::bindCurrent | ( | unsigned | processor | ) | [static] |
bind current thread to a processor (current as in callee's context)
Definition at line 246 of file thread.cpp.
Referenced by lass::util::SelfParticipating< TaskType, ConsumerType, IdlePolicy >::SelfParticipating(), and lass::util::SelfParticipating< TaskType, ConsumerType, IdlePolicy >::~SelfParticipating().
virtual void lass::util::Thread::doRun | ( | ) | [private, pure virtual] |
void lass::util::NonCopyable::swap | ( | NonCopyable & | ) | [inline, protected, inherited] |
friend class impl::ThreadInternal [friend] |
impl::ThreadInternal* lass::util::Thread::pimpl_ [private] |
Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by 1.5.7.1 |