#include <llthread.h>
Inheritance diagram for LLThread:
Public Types | |
typedef enum LLThread::e_thread_status | EThreadStatus |
STOPPED = 0 | |
RUNNING = 1 | |
QUITTING = 2 | |
enum | e_thread_status { STOPPED = 0, RUNNING = 1, QUITTING = 2 } |
Public Member Functions | |
LLThread (const std::string &name, apr_pool_t *poolp=NULL) | |
virtual | ~LLThread () |
virtual void | shutdown () |
bool | isQuitting () const |
bool | isStopped () const |
void | pause () |
void | unpause () |
bool | isPaused () |
void | wake () |
void | wakeLocked () |
void | checkPause () |
void | start (void) |
apr_pool_t * | getAPRPool () |
Static Public Member Functions | |
static void | yield () |
Protected Member Functions | |
void | setQuitting () |
virtual void | run (void)=0 |
virtual bool | runCondition (void) |
void | lockData () |
void | unlockData () |
bool | shouldSleep (void) |
Protected Attributes | |
std::string | mName |
LLCondition * | mRunCondition |
apr_thread_t * | mAPRThreadp |
apr_pool_t * | mAPRPoolp |
BOOL | mIsLocalPool |
EThreadStatus | mStatus |
Static Private Member Functions | |
static void *APR_THREAD_FUNC | staticRun (apr_thread_t *apr_threadp, void *datap) |
Private Attributes | |
BOOL | mPaused |
Definition at line 45 of file llthread.h.
typedef enum LLThread::e_thread_status LLThread::EThreadStatus |
LLThread::LLThread | ( | const std::string & | name, | |
apr_pool_t * | poolp = NULL | |||
) |
Definition at line 84 of file llthread.cpp.
References FALSE, mAPRPoolp, mIsLocalPool, mRunCondition, NULL, and TRUE.
LLThread::~LLThread | ( | ) | [virtual] |
void LLThread::checkPause | ( | ) |
Definition at line 201 of file llthread.cpp.
References LLMutex::lock(), mRunCondition, shouldSleep(), LLMutex::unlock(), and LLCondition::wait().
Referenced by LLQueuedThread::run(), and LLWorkerClass::yield().
apr_pool_t* LLThread::getAPRPool | ( | ) | [inline] |
Definition at line 84 of file llthread.h.
References mAPRPoolp.
Referenced by LLWorkerThread::LLWorkerThread().
bool LLThread::isPaused | ( | ) | [inline] |
Definition at line 70 of file llthread.h.
References isStopped(), mPaused, and TRUE.
Referenced by LLQueuedThread::incQueue(), LLVFile::setMaxSize(), shouldSleep(), LLVFile::waitForLock(), and LLQueuedThread::waitForResult().
bool LLThread::isQuitting | ( | ) | const [inline] |
Definition at line 62 of file llthread.h.
References mStatus, and QUITTING.
Referenced by LLQueuedThread::processNextRequest(), and LLQueuedThread::run().
bool LLThread::isStopped | ( | ) | const [inline] |
Definition at line 63 of file llthread.h.
References mStatus, and STOPPED.
Referenced by isPaused(), shutdown(), and LLQueuedThread::shutdown().
void LLThread::lockData | ( | ) | [inline, protected] |
Definition at line 176 of file llthread.h.
References LLMutex::lock(), and mRunCondition.
Referenced by LLQueuedThread::abortRequest(), LLQueuedThread::addRequest(), LLQueuedThread::completeRequest(), LLQueuedThread::generateHandle(), LLQueuedThread::getPending(), LLQueuedThread::getRequest(), LLQueuedThread::getRequestStatus(), LLQueuedThread::printQueueStats(), LLQueuedThread::processNextRequest(), LLQueuedThread::setFlags(), LLQueuedThread::setPriority(), and LLQueuedThread::waitForResult().
void LLThread::pause | ( | ) |
Definition at line 172 of file llthread.cpp.
References mPaused.
Referenced by main_loop(), LLViewerWindow::stopGL(), and LLQueuedThread::waitForResult().
bool LLThread::runCondition | ( | void | ) | [protected, virtual] |
Reimplemented in LLQueuedThread.
Definition at line 192 of file llthread.cpp.
Referenced by shouldSleep().
void LLThread::setQuitting | ( | ) | [protected] |
Definition at line 217 of file llthread.cpp.
References LLMutex::lock(), mRunCondition, mStatus, QUITTING, RUNNING, LLMutex::unlock(), and wake().
Referenced by LLVFSThread::cleanupClass(), LLLFSThread::cleanupClass(), shutdown(), and LLQueuedThread::shutdown().
bool LLThread::shouldSleep | ( | void | ) | [inline, protected] |
Definition at line 116 of file llthread.h.
References isPaused(), mStatus, runCondition(), and RUNNING.
Referenced by checkPause(), wake(), and wakeLocked().
void LLThread::shutdown | ( | ) | [virtual] |
Reimplemented in LLQueuedThread.
Definition at line 110 of file llthread.cpp.
References isStopped(), llendl, llinfos, llwarns, mAPRPoolp, mAPRThreadp, mIsLocalPool, mName, mRunCondition, ms_sleep(), mStatus, NULL, S32, setQuitting(), and yield().
Referenced by ~LLThread().
Definition at line 159 of file llthread.cpp.
References mAPRPoolp, mAPRThreadp, NULL, and staticRun().
Referenced by LLQueuedThread::LLQueuedThread(), and LLApp::setupErrorHandling().
void LLThread::unlockData | ( | ) | [inline, protected] |
Definition at line 181 of file llthread.h.
References mRunCondition, and LLMutex::unlock().
Referenced by LLQueuedThread::abortRequest(), LLQueuedThread::addRequest(), LLQueuedThread::completeRequest(), LLQueuedThread::generateHandle(), LLQueuedThread::getPending(), LLQueuedThread::getRequest(), LLQueuedThread::getRequestStatus(), LLQueuedThread::printQueueStats(), LLQueuedThread::processNextRequest(), LLQueuedThread::setFlags(), LLQueuedThread::setPriority(), and LLQueuedThread::waitForResult().
void LLThread::unpause | ( | ) |
Definition at line 181 of file llthread.cpp.
References mPaused, and wake().
Referenced by LLQueuedThread::shutdown(), and LLQueuedThread::updateQueue().
void LLThread::wake | ( | ) |
Definition at line 239 of file llthread.cpp.
References LLMutex::lock(), mRunCondition, shouldSleep(), LLCondition::signal(), and LLMutex::unlock().
Referenced by LLQueuedThread::incQueue(), setQuitting(), and unpause().
void LLThread::wakeLocked | ( | ) |
Definition at line 249 of file llthread.cpp.
References mRunCondition, shouldSleep(), and LLCondition::signal().
void LLThread::yield | ( | ) | [static] |
Definition at line 230 of file llthread.cpp.
Referenced by shutdown(), LLQueuedThread::shutdown(), LLQueuedThread::waitForResult(), LLQueuedThread::waitOnPending(), and LLWorkerClass::yield().
apr_pool_t* LLThread::mAPRPoolp [protected] |
Definition at line 97 of file llthread.h.
Referenced by getAPRPool(), LLThread(), LLLFSThread::Request::processRequest(), shutdown(), and start().
apr_thread_t* LLThread::mAPRThreadp [protected] |
BOOL LLThread::mIsLocalPool [protected] |
std::string LLThread::mName [protected] |
Definition at line 93 of file llthread.h.
Referenced by LLQueuedThread::run(), shutdown(), LLQueuedThread::shutdown(), staticRun(), and LLWorkerThread::~LLWorkerThread().
BOOL LLThread::mPaused [private] |
LLCondition* LLThread::mRunCondition [protected] |
Definition at line 94 of file llthread.h.
Referenced by checkPause(), LLThread(), lockData(), setQuitting(), shutdown(), unlockData(), wake(), and wakeLocked().
EThreadStatus LLThread::mStatus [protected] |
Definition at line 99 of file llthread.h.
Referenced by LLQueuedThread::addRequest(), isQuitting(), isStopped(), LLQueuedThread::processNextRequest(), setQuitting(), shouldSleep(), shutdown(), LLQueuedThread::shutdown(), and staticRun().