#include <Thread.hxx>
Public Member Functions | |
Thread (bool realtime=false) | |
virtual | ~Thread () |
virtual void | Start () |
virtual void | Stop () |
void | Sleep () |
void | Sleep (unsigned int milliseconds) |
void | WakeUp () |
void | Yield () |
void | SetThreadCode (const CBL::Functor0 &thread_code) |
void | SetCleanupCode (const CBL::Functor0 &cleanup_code) |
bool | operator== (const Thread &other) const |
bool | IsCancelled () const |
bool | IsRunning () const |
Protected Member Functions | |
virtual void | SetupPriorityPolicy () |
Protected Attributes | |
bool | mRealtime |
bool | mHasCode |
bool | mHasCleanup |
pthread_t | mThreadID |
bool | mIsCancelled |
bool | mRunning |
CBL::Functor0 | mThreadCode |
CBL::Functor0 | mCleanUpCode |
Condition | mSleepCondition |
Definition at line 39 of file Thread.hxx.
CLAM::Thread::Thread | ( | bool | realtime = false |
) |
Definition at line 42 of file Thread.cxx.
CLAM::Thread::~Thread | ( | ) | [virtual] |
Definition at line 51 of file Thread.cxx.
bool CLAM::Thread::IsCancelled | ( | ) | const [inline] |
Definition at line 65 of file Thread.hxx.
References mIsCancelled.
bool CLAM::Thread::IsRunning | ( | ) | const [inline] |
Definition at line 70 of file Thread.hxx.
References mRunning.
Referenced by CLAM::ThreadPool::EmptyPool(), and CLAM::ThreadPool::GetThreadFromPool().
bool CLAM::Thread::operator== | ( | const Thread & | other | ) | const |
void CLAM::Thread::SetCleanupCode | ( | const CBL::Functor0 & | cleanup_code | ) |
Definition at line 123 of file Thread.cxx.
References mCleanUpCode, and mHasCleanup.
Referenced by CLAM::ProcessingKernel::AttachToThread().
void CLAM::Thread::SetThreadCode | ( | const CBL::Functor0 & | thread_code | ) |
Definition at line 117 of file Thread.cxx.
References mHasCode, and mThreadCode.
Referenced by CLAM::ProcessingKernel::AttachToThread().
void CLAM::Thread::SetupPriorityPolicy | ( | ) | [protected, virtual] |
Definition at line 57 of file Thread.cxx.
References mRealtime.
Definition at line 151 of file Thread.cxx.
void CLAM::Thread::Sleep | ( | ) |
Definition at line 156 of file Thread.cxx.
void CLAM::Thread::Start | ( | void | ) | [virtual] |
Reimplemented in CLAM::PooledThread.
Definition at line 93 of file Thread.cxx.
References CLAM_ASSERT, mHasCode, mRunning, mThreadID, and NULL.
void CLAM::Thread::Stop | ( | void | ) | [virtual] |
Definition at line 101 of file Thread.cxx.
References mIsCancelled, and mRunning.
Referenced by CLAM::ThreadPool::EmptyPool(), and ~Thread().
void CLAM::Thread::WakeUp | ( | ) |
Definition at line 176 of file Thread.cxx.
References mSleepCondition, and CLAM::Condition::NotifyOne().
void CLAM::Thread::Yield | ( | ) |
Definition at line 109 of file Thread.cxx.
References CLAM_ASSERT.
CBL::Functor0 CLAM::Thread::mCleanUpCode [protected] |
Definition at line 85 of file Thread.hxx.
Referenced by SetCleanupCode().
bool CLAM::Thread::mHasCleanup [protected] |
Definition at line 80 of file Thread.hxx.
Referenced by SetCleanupCode().
bool CLAM::Thread::mHasCode [protected] |
Definition at line 79 of file Thread.hxx.
Referenced by SetThreadCode(), and Start().
bool CLAM::Thread::mIsCancelled [protected] |
Definition at line 82 of file Thread.hxx.
Referenced by IsCancelled(), and Stop().
bool CLAM::Thread::mRealtime [protected] |
Definition at line 78 of file Thread.hxx.
Referenced by SetupPriorityPolicy().
bool CLAM::Thread::mRunning [protected] |
Definition at line 83 of file Thread.hxx.
Referenced by IsRunning(), Start(), Stop(), and ~Thread().
Condition CLAM::Thread::mSleepCondition [protected] |
Definition at line 86 of file Thread.hxx.
Referenced by WakeUp().
CBL::Functor0 CLAM::Thread::mThreadCode [protected] |
Definition at line 84 of file Thread.hxx.
Referenced by SetThreadCode().
pthread_t CLAM::Thread::mThreadID [protected] |
Definition at line 81 of file Thread.hxx.
Referenced by Start().