#include <llqueuedthread.h>
Inheritance diagram for LLQueuedThread:
Definition at line 49 of file llqueuedthread.h.
typedef U32 LLQueuedThread::handle_t |
Definition at line 77 of file llqueuedthread.h.
typedef LLSimpleHash<handle_t, REQUEST_HASH_SIZE> LLQueuedThread::request_hash_t [protected] |
Definition at line 207 of file llqueuedthread.h.
typedef std::set<QueuedRequest*, queued_request_less> LLQueuedThread::request_queue_t [protected] |
Definition at line 203 of file llqueuedthread.h.
anonymous enum [protected] |
Definition at line 71 of file llqueuedthread.h.
PRIORITY_IMMEDIATE | |
PRIORITY_URGENT | |
PRIORITY_HIGH | |
PRIORITY_NORMAL | |
PRIORITY_LOW | |
PRIORITY_LOWBITS | |
PRIORITY_HIGHBITS |
Definition at line 53 of file llqueuedthread.h.
STATUS_EXPIRED | |
STATUS_UNKNOWN | |
STATUS_QUEUED | |
STATUS_INPROGRESS | |
STATUS_COMPLETE | |
STATUS_ABORTED | |
STATUS_DELETE |
Definition at line 62 of file llqueuedthread.h.
LLQueuedThread::LLQueuedThread | ( | const std::string & | name, | |
bool | threaded = true | |||
) |
LLQueuedThread::~LLQueuedThread | ( | ) | [virtual] |
LLQueuedThread::LLQueuedThread | ( | const LLQueuedThread & | ) | [private] |
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().
bool LLQueuedThread::addRequest | ( | QueuedRequest * | req | ) | [protected] |
Definition at line 204 of file llqueuedthread.cpp.
References incQueue(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::insert(), LLThread::lockData(), mRequestHash, mRequestQueue, LLThread::mStatus, LLThread::QUITTING, LLQueuedThread::QueuedRequest::setStatus(), STATUS_QUEUED, and LLThread::unlockData().
Referenced by LLWorkerThread::addWorkRequest(), LLVFSThread::read(), LLLFSThread::read(), LLVFSThread::readImmediate(), LLVFSThread::write(), LLLFSThread::write(), and LLVFSThread::writeImmediate().
bool LLQueuedThread::check | ( | ) |
Definition at line 358 of file llqueuedthread.cpp.
References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::get_element_at_index(), i, llendl, llerrs, mNextHandle, mRequestHash, and REQUEST_HASH_SIZE.
bool LLQueuedThread::completeRequest | ( | handle_t | handle | ) |
Definition at line 337 of file llqueuedthread.cpp.
References LLQueuedThread::QueuedRequest::deleteRequest(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::erase(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLQueuedThread::QueuedRequest::getStatus(), llassert_always, LLThread::lockData(), mRequestHash, STATUS_INPROGRESS, STATUS_QUEUED, and LLThread::unlockData().
Referenced by LLWorkerClass::checkWork(), LLVFile::isReadComplete(), LLVFSThread::readImmediate(), LLWorkerThread::update(), and LLVFSThread::writeImmediate().
LLQueuedThread::handle_t LLQueuedThread::generateHandle | ( | ) | [protected] |
Definition at line 192 of file llqueuedthread.cpp.
References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLThread::lockData(), mNextHandle, mRequestHash, nullHandle(), and LLThread::unlockData().
Referenced by LLWorkerThread::addWorkRequest(), LLVFSThread::read(), LLLFSThread::read(), LLVFSThread::readImmediate(), LLVFSThread::write(), LLLFSThread::write(), and LLVFSThread::writeImmediate().
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().
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().
LLQueuedThread::status_t LLQueuedThread::getRequestStatus | ( | handle_t | handle | ) |
Definition at line 279 of file llqueuedthread.cpp.
References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLQueuedThread::QueuedRequest::getStatus(), LLThread::lockData(), mRequestHash, STATUS_EXPIRED, and LLThread::unlockData().
bool LLQueuedThread::getThreaded | ( | ) | [inline] |
void LLQueuedThread::incQueue | ( | ) | [protected] |
Definition at line 133 of file llqueuedthread.cpp.
References LLThread::isPaused(), mThreaded, and LLThread::wake().
Referenced by addRequest().
static handle_t LLQueuedThread::nullHandle | ( | ) | [inline, static] |
Definition at line 153 of file llqueuedthread.h.
Referenced by LLWorkerClass::abortWork(), LLWorkerClass::addWork(), LLWorkerThread::addWorkRequest(), LLWorkerClass::checkWork(), LLTextureFetchWorker::deleteOK(), LLTextureCacheWorker::doRead(), LLTextureFetchWorker::doWork(), LLTextureCacheWorker::doWrite(), LLVorbisDecodeState::finishDecode(), LLTextureFetchWorker::finishWork(), generateHandle(), getRequest(), LLVFile::isReadComplete(), LLVFile::LLVFile(), LLVorbisDecodeState::LLVorbisDecodeState(), LLVFSThread::read(), LLVFile::read(), LLVFile::remove(), LLVFile::rename(), LLWorkerClass::setPriority(), LLVFile::setReadPriority(), LLWorkerClass::setWorkerThread(), LLWorkerThread::update(), waitForResult(), LLVFSThread::write(), LLVFile::write(), LLTextureCache::writeToCache(), LLTextureFetchWorker::writeToCacheComplete(), LLTextureFetchWorker::~LLTextureFetchWorker(), LLVFile::~LLVFile(), and LLWorkerClass::~LLWorkerClass().
LLQueuedThread& LLQueuedThread::operator= | ( | const LLQueuedThread & | ) | [private] |
void LLQueuedThread::printQueueStats | ( | ) |
Definition at line 176 of file llqueuedthread.cpp.
References llendl, llformat(), llinfos, LLThread::lockData(), mRequestQueue, and LLThread::unlockData().
Definition at line 381 of file llqueuedthread.cpp.
References LLQueuedThread::QueuedRequest::deleteRequest(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::erase(), LLQueuedThread::QueuedRequest::finishRequest(), FLAG_ABORT, FLAG_AUTO_COMPLETE, LLQueuedThread::QueuedRequest::getFlags(), getPending(), LLQueuedThread::QueuedRequest::getPriority(), LLQueuedThread::QueuedRequest::getStatus(), LLThread::isQuitting(), llassert_always, LLThread::lockData(), mRequestHash, mRequestQueue, ms_sleep(), LLThread::mStatus, NULL, PRIORITY_NORMAL, LLQueuedThread::QueuedRequest::processRequest(), LLThread::QUITTING, S32, LLQueuedThread::QueuedRequest::setStatus(), STATUS_ABORTED, STATUS_COMPLETE, STATUS_INPROGRESS, STATUS_QUEUED, and LLThread::unlockData().
Referenced by run(), and updateQueue().
Implements LLThread.
Definition at line 480 of file llqueuedthread.cpp.
References LLThread::checkPause(), FALSE, LLThread::isQuitting(), llendl, llinfos, mIdleThread, LLThread::mName, processNextRequest(), and TRUE.
bool LLQueuedThread::runCondition | ( | void | ) | [private, virtual] |
Reimplemented from LLThread.
Definition at line 471 of file llqueuedthread.cpp.
References mIdleThread, and mRequestQueue.
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().
Definition at line 315 of file llqueuedthread.cpp.
References LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLQueuedThread::QueuedRequest::getStatus(), llverify, LLThread::lockData(), mRequestHash, mRequestQueue, LLQueuedThread::QueuedRequest::setPriority(), STATUS_INPROGRESS, STATUS_QUEUED, and LLThread::unlockData().
Referenced by LLWorkerClass::abortWork(), LLWorkerClass::setPriority(), and LLVFile::setReadPriority().
void LLQueuedThread::shutdown | ( | ) | [virtual] |
Reimplemented from LLThread.
Definition at line 57 of file llqueuedthread.cpp.
References LLQueuedThread::QueuedRequest::deleteRequest(), LLQueuedThread::QueuedRequest::getStatus(), LLThread::isStopped(), llendl, llwarns, LLThread::mName, mRequestHash, ms_sleep(), LLThread::mStatus, mThreaded, LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::pop_element(), S32, LLThread::setQuitting(), STATUS_INPROGRESS, STATUS_QUEUED, LLThread::STOPPED, LLThread::unpause(), and LLThread::yield().
Referenced by cleanup_app(), and ~LLQueuedThread().
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().
Definition at line 109 of file llqueuedthread.cpp.
References LLTimer::getElapsedTimeF64(), getPending(), mThreaded, processNextRequest(), S32, and LLThread::unpause().
Referenced by update().
bool LLQueuedThread::waitForResult | ( | handle_t | handle, | |
bool | auto_complete = true | |||
) |
Definition at line 226 of file llqueuedthread.cpp.
References LLQueuedThread::QueuedRequest::deleteRequest(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::erase(), LLSimpleHash< HASH_KEY_TYPE, TABLE_SIZE >::find(), LLQueuedThread::QueuedRequest::getStatus(), LLThread::isPaused(), llassert, LLThread::lockData(), mRequestHash, mThreaded, nullHandle(), LLThread::pause(), STATUS_COMPLETE, LLThread::unlockData(), update(), and LLThread::yield().
Referenced by LLVFSThread::readImmediate(), and LLVFSThread::writeImmediate().
void LLQueuedThread::waitOnPending | ( | ) |
Definition at line 157 of file llqueuedthread.cpp.
References mIdleThread, mThreaded, update(), and LLThread::yield().
LLAtomic32<BOOL> LLQueuedThread::mIdleThread [protected] |
Definition at line 201 of file llqueuedthread.h.
Referenced by run(), runCondition(), and waitOnPending().
handle_t LLQueuedThread::mNextHandle [protected] |
request_hash_t LLQueuedThread::mRequestHash [protected] |
Definition at line 208 of file llqueuedthread.h.
Referenced by abortRequest(), addRequest(), check(), completeRequest(), generateHandle(), getRequest(), getRequestStatus(), processNextRequest(), setFlags(), setPriority(), shutdown(), and waitForResult().
request_queue_t LLQueuedThread::mRequestQueue [protected] |
Definition at line 204 of file llqueuedthread.h.
Referenced by addRequest(), LLTextureFetch::dump(), getPending(), printQueueStats(), processNextRequest(), runCondition(), and setPriority().
BOOL LLQueuedThread::mThreaded [protected] |
Definition at line 200 of file llqueuedthread.h.
Referenced by getThreaded(), incQueue(), LLQueuedThread(), shutdown(), updateQueue(), waitForResult(), and waitOnPending().