LLThread Class Reference

#include <llthread.h>

Inheritance diagram for LLThread:

Inheritance graph
[legend]
Collaboration diagram for LLThread:

Collaboration graph
[legend]
List of all members.

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

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
LLConditionmRunCondition
apr_thread_t * mAPRThreadp
apr_pool_tmAPRPoolp
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

Detailed Description

Definition at line 45 of file llthread.h.


Member Typedef Documentation

typedef enum LLThread::e_thread_status LLThread::EThreadStatus


Member Enumeration Documentation

enum LLThread::e_thread_status

Enumerator:
STOPPED 
RUNNING 
QUITTING 

Definition at line 48 of file llthread.h.


Constructor & Destructor Documentation

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]

Definition at line 105 of file llthread.cpp.

References shutdown().


Member Function Documentation

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

virtual void LLThread::run ( void   )  [protected, pure virtual]

Implemented in LLErrorThread, and LLQueuedThread.

Referenced by staticRun().

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

void LLThread::start ( void   ) 

Definition at line 159 of file llthread.cpp.

References mAPRPoolp, mAPRThreadp, NULL, and staticRun().

Referenced by LLQueuedThread::LLQueuedThread(), and LLApp::setupErrorHandling().

void *APR_THREAD_FUNC LLThread::staticRun ( apr_thread_t *  apr_threadp,
void datap 
) [static, private]

Definition at line 65 of file llthread.cpp.

References llendl, llinfos, mName, mStatus, NULL, run(), RUNNING, and STOPPED.

Referenced by start().

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


Member Data Documentation

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]

Definition at line 96 of file llthread.h.

Referenced by shutdown(), and start().

BOOL LLThread::mIsLocalPool [protected]

Definition at line 98 of file llthread.h.

Referenced by LLThread(), and shutdown().

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]

Definition at line 87 of file llthread.h.

Referenced by isPaused(), pause(), and unpause().

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


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:51 2010 for Second Life Viewer by  doxygen 1.4.7