#include <llthread.h>


Public Types | |
| enum | e_thread_status { STOPPED = 0, RUNNING = 1, QUITTING = 2 } |
| typedef enum LLThread::e_thread_status | EThreadStatus |
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 U32 | currentID () |
| 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 86 of file llthread.cpp.
References FALSE, mAPRPoolp, mIsLocalPool, mRunCondition, NULL, and TRUE.
| LLThread::~LLThread | ( | ) | [virtual] |
Definition at line 107 of file llthread.cpp.
References shutdown().

| void LLThread::shutdown | ( | ) | [virtual] |
Reimplemented in LLQueuedThread.
Definition at line 112 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().


| bool LLThread::isQuitting | ( | ) | const [inline] |
Definition at line 59 of file llthread.h.
References mStatus, and QUITTING.
Referenced by LLQueuedThread::processNextRequest(), and LLQueuedThread::run().

| bool LLThread::isStopped | ( | ) | const [inline] |
Definition at line 60 of file llthread.h.
References mStatus, and STOPPED.
Referenced by isPaused(), shutdown(), and LLQueuedThread::shutdown().

| U32 LLThread::currentID | ( | ) | [static] |
Definition at line 231 of file llthread.cpp.
Referenced by LLCurl::ssl_thread_id().

| void LLThread::yield | ( | ) | [static] |
Definition at line 237 of file llthread.cpp.
Referenced by shutdown(), LLQueuedThread::shutdown(), LLQueuedThread::waitForResult(), LLQueuedThread::waitOnPending(), and LLWorkerClass::yield().

| void LLThread::pause | ( | ) |
Definition at line 174 of file llthread.cpp.
References mPaused.
Referenced by LLAppViewer::mainLoop(), LLViewerWindow::stopGL(), and LLQueuedThread::waitForResult().

| void LLThread::unpause | ( | ) |
Definition at line 183 of file llthread.cpp.
References mPaused, and wake().
Referenced by LLQueuedThread::shutdown(), and LLQueuedThread::updateQueue().


| 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().


| void LLThread::wake | ( | ) |
Definition at line 246 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 256 of file llthread.cpp.
References mRunCondition, shouldSleep(), and LLCondition::signal().

| void LLThread::checkPause | ( | ) |
Definition at line 203 of file llthread.cpp.
References LLMutex::lock(), mRunCondition, shouldSleep(), LLMutex::unlock(), and LLCondition::wait().
Referenced by LLQueuedThread::run(), and LLWorkerClass::yield().


| void LLThread::start | ( | void | ) |
Definition at line 161 of file llthread.cpp.
References mAPRPoolp, mAPRThreadp, NULL, and staticRun().
Referenced by LLWatchdog::init(), LLQueuedThread::LLQueuedThread(), and LLApp::setupErrorHandling().


| apr_pool_t* LLThread::getAPRPool | ( | ) | [inline] |
Definition at line 84 of file llthread.h.
References mAPRPoolp.
Referenced by LLWorkerThread::LLWorkerThread().

| void *APR_THREAD_FUNC LLThread::staticRun | ( | apr_thread_t * | apr_threadp, | |
| void * | datap | |||
| ) | [static, private] |
| void LLThread::setQuitting | ( | ) | [protected] |
Definition at line 219 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().


| virtual void LLThread::run | ( | void | ) | [protected, pure virtual] |
Implemented in LLErrorThread, LLQueuedThread, and LLWatchdogTimerThread.
Referenced by staticRun().

| bool LLThread::runCondition | ( | void | ) | [protected, virtual] |
Reimplemented in LLQueuedThread.
Definition at line 194 of file llthread.cpp.
Referenced by shouldSleep().

| 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::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().


| 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().


BOOL LLThread::mPaused [private] |
std::string LLThread::mName [protected] |
Definition at line 93 of file llthread.h.
Referenced by LLQueuedThread::run(), shutdown(), LLQueuedThread::shutdown(), staticRun(), and LLWorkerThread::~LLWorkerThread().
LLCondition* LLThread::mRunCondition [protected] |
Definition at line 94 of file llthread.h.
Referenced by checkPause(), LLThread(), lockData(), setQuitting(), shutdown(), unlockData(), wake(), and wakeLocked().
apr_thread_t* LLThread::mAPRThreadp [protected] |
apr_pool_t* LLThread::mAPRPoolp [protected] |
Definition at line 97 of file llthread.h.
Referenced by getAPRPool(), LLThread(), LLLFSThread::Request::processRequest(), shutdown(), and start().
BOOL LLThread::mIsLocalPool [protected] |
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().
1.5.5