LLQueuedThread Class Reference

#include <llqueuedthread.h>

Inheritance diagram for LLQueuedThread:

Inheritance graph
[legend]
Collaboration diagram for LLQueuedThread:

Collaboration graph
[legend]

List of all members.

Public Types

enum  priority_t {
  PRIORITY_IMMEDIATE = 0x7FFFFFFF, PRIORITY_URGENT = 0x40000000, PRIORITY_HIGH = 0x30000000, PRIORITY_NORMAL = 0x20000000,
  PRIORITY_LOW = 0x10000000, PRIORITY_LOWBITS = 0x0FFFFFFF, PRIORITY_HIGHBITS = 0x70000000
}
enum  status_t {
  STATUS_EXPIRED = -1, STATUS_UNKNOWN = 0, STATUS_QUEUED = 1, STATUS_INPROGRESS = 2,
  STATUS_COMPLETE = 3, STATUS_ABORTED = 4, STATUS_DELETE = 5
}
enum  flags_t { FLAG_AUTO_COMPLETE = 1, FLAG_AUTO_DELETE = 2, FLAG_ABORT = 4 }
typedef U32 handle_t

Public Member Functions

 LLQueuedThread (const std::string &name, bool threaded=true)
virtual ~LLQueuedThread ()
virtual void shutdown ()
bool waitForResult (handle_t handle, bool auto_complete=true)
virtual S32 update (U32 max_time_ms)
S32 updateQueue (U32 max_time_ms)
void waitOnPending ()
void printQueueStats ()
S32 getPending ()
bool getThreaded ()
status_t getRequestStatus (handle_t handle)
void abortRequest (handle_t handle, bool autocomplete)
void setFlags (handle_t handle, U32 flags)
void setPriority (handle_t handle, U32 priority)
bool completeRequest (handle_t handle)
QueuedRequestgetRequest (handle_t handle)
bool check ()

Static Public Member Functions

static handle_t nullHandle ()

Protected Types

enum  { REQUEST_HASH_SIZE = 512 }
typedef std::set
< QueuedRequest
*, queued_request_less
request_queue_t
typedef LLSimpleHash< handle_t,
REQUEST_HASH_SIZE > 
request_hash_t

Protected Member Functions

handle_t generateHandle ()
bool addRequest (QueuedRequest *req)
S32 processNextRequest (void)
void incQueue ()

Protected Attributes

BOOL mThreaded
LLAtomic32< BOOLmIdleThread
request_queue_t mRequestQueue
request_hash_t mRequestHash
handle_t mNextHandle

Private Member Functions

 LLQueuedThread (const LLQueuedThread &)
LLQueuedThreadoperator= (const LLQueuedThread &)
virtual bool runCondition (void)
virtual void run (void)

Classes

struct  queued_request_less
class  QueuedRequest


Detailed Description

Definition at line 49 of file llqueuedthread.h.


Member Typedef Documentation

Definition at line 77 of file llqueuedthread.h.

Definition at line 203 of file llqueuedthread.h.

typedef LLSimpleHash<handle_t, REQUEST_HASH_SIZE> LLQueuedThread::request_hash_t [protected]

Definition at line 207 of file llqueuedthread.h.


Member Enumeration Documentation

Enumerator:
PRIORITY_IMMEDIATE 
PRIORITY_URGENT 
PRIORITY_HIGH 
PRIORITY_NORMAL 
PRIORITY_LOW 
PRIORITY_LOWBITS 
PRIORITY_HIGHBITS 

Definition at line 53 of file llqueuedthread.h.

Enumerator:
STATUS_EXPIRED 
STATUS_UNKNOWN 
STATUS_QUEUED 
STATUS_INPROGRESS 
STATUS_COMPLETE 
STATUS_ABORTED 
STATUS_DELETE 

Definition at line 62 of file llqueuedthread.h.

Enumerator:
FLAG_AUTO_COMPLETE 
FLAG_AUTO_DELETE 
FLAG_ABORT 

Definition at line 71 of file llqueuedthread.h.

anonymous enum [protected]

Enumerator:
REQUEST_HASH_SIZE 

Definition at line 206 of file llqueuedthread.h.


Constructor & Destructor Documentation

LLQueuedThread::LLQueuedThread ( const std::string &  name,
bool  threaded = true 
)

Definition at line 38 of file llqueuedthread.cpp.

References mThreaded, and LLThread::start().

Here is the call graph for this function:

LLQueuedThread::~LLQueuedThread (  )  [virtual]

Definition at line 51 of file llqueuedthread.cpp.

References shutdown().

Here is the call graph for this function:

LLQueuedThread::LLQueuedThread ( const LLQueuedThread  )  [private]


Member Function Documentation

static handle_t LLQueuedThread::nullHandle (  )  [inline, static]

void LLQueuedThread::shutdown (  )  [virtual]

LLQueuedThread& LLQueuedThread::operator= ( const LLQueuedThread  )  [private]

bool LLQueuedThread::runCondition ( void   )  [private, virtual]

Reimplemented from LLThread.

Definition at line 471 of file llqueuedthread.cpp.

References mIdleThread, and mRequestQueue.

void LLQueuedThread::run ( void   )  [private, virtual]

Implements LLThread.

Definition at line 480 of file llqueuedthread.cpp.

References LLThread::checkPause(), FALSE, LLThread::isQuitting(), llendl, llinfos, mIdleThread, LLThread::mName, processNextRequest(), and TRUE.

Here is the call graph for this function:

LLQueuedThread::handle_t LLQueuedThread::generateHandle (  )  [protected]

bool LLQueuedThread::addRequest ( QueuedRequest req  )  [protected]

S32 LLQueuedThread::processNextRequest ( void   )  [protected]

void LLQueuedThread::incQueue (  )  [protected]

Definition at line 133 of file llqueuedthread.cpp.

References LLThread::isPaused(), mThreaded, and LLThread::wake().

Referenced by addRequest().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLQueuedThread::waitForResult ( LLQueuedThread::handle_t  handle,
bool  auto_complete = true 
)

S32 LLQueuedThread::update ( U32  max_time_ms  )  [virtual]

Reimplemented in LLWorkerThread, LLTextureCache, and LLTextureFetch.

Definition at line 104 of file llqueuedthread.cpp.

References updateQueue().

Referenced by LLVFSThread::cleanupClass(), LLLFSThread::cleanupClass(), LLVFile::setMaxSize(), LLWorkerThread::update(), LLVFSThread::updateClass(), LLLFSThread::updateClass(), LLVFile::waitForLock(), waitForResult(), and waitOnPending().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 LLQueuedThread::updateQueue ( U32  max_time_ms  ) 

Definition at line 109 of file llqueuedthread.cpp.

References LLTimer::getElapsedTimeF64(), getPending(), mThreaded, processNextRequest(), S32, and LLThread::unpause().

Referenced by update().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLQueuedThread::waitOnPending (  ) 

Definition at line 157 of file llqueuedthread.cpp.

References mIdleThread, mThreaded, update(), and LLThread::yield().

Here is the call graph for this function:

void LLQueuedThread::printQueueStats (  ) 

Definition at line 176 of file llqueuedthread.cpp.

References LLQueuedThread::QueuedRequest::getStatus(), llendl, llformat(), llinfos, LLThread::lockData(), mRequestQueue, and LLThread::unlockData().

Here is the call graph for this function:

S32 LLQueuedThread::getPending (  ) 

Definition at line 147 of file llqueuedthread.cpp.

References LLThread::lockData(), mRequestQueue, S32, and LLThread::unlockData().

Referenced by LLVFSThread::cleanupClass(), LLLFSThread::cleanupClass(), LLGLTexMemBar::draw(), processNextRequest(), LLVFile::setMaxSize(), LLVFSThread::updateClass(), LLLFSThread::updateClass(), and updateQueue().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLQueuedThread::getThreaded (  )  [inline]

Definition at line 184 of file llqueuedthread.h.

References mThreaded.

LLQueuedThread::status_t LLQueuedThread::getRequestStatus ( handle_t  handle  ) 

void LLQueuedThread::abortRequest ( handle_t  handle,
bool  autocomplete 
)

Definition at line 292 of file llqueuedthread.cpp.

References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), FLAG_ABORT, FLAG_AUTO_COMPLETE, LLThread::lockData(), mRequestHash, LLQueuedThread::QueuedRequest::setFlags(), and LLThread::unlockData().

Referenced by LLWorkerClass::abortWork().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLQueuedThread::setFlags ( handle_t  handle,
U32  flags 
)

Definition at line 304 of file llqueuedthread.cpp.

References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLThread::lockData(), mRequestHash, LLQueuedThread::QueuedRequest::setFlags(), and LLThread::unlockData().

Referenced by LLVFile::~LLVFile().

Here is the call graph for this function:

Here is the caller graph for this function:

void LLQueuedThread::setPriority ( handle_t  handle,
U32  priority 
)

bool LLQueuedThread::completeRequest ( handle_t  handle  ) 

LLQueuedThread::QueuedRequest * LLQueuedThread::getRequest ( handle_t  handle  ) 

Definition at line 267 of file llqueuedthread.cpp.

References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLThread::lockData(), mRequestHash, nullHandle(), and LLThread::unlockData().

Referenced by LLWorkerClass::checkWork(), LLVFile::isReadComplete(), and LLWorkerClass::~LLWorkerClass().

Here is the call graph for this function:

Here is the caller graph for this function:

bool LLQueuedThread::check (  ) 


Member Data Documentation

Definition at line 201 of file llqueuedthread.h.

Referenced by run(), runCondition(), and waitOnPending().

Definition at line 210 of file llqueuedthread.h.

Referenced by check(), and generateHandle().


The documentation for this class was generated from the following files:

Generated on Fri May 16 09:01:13 2008 for SecondLife by  doxygen 1.5.5