diff options
Diffstat (limited to 'indra/llcommon/llworkerthread.cpp')
-rw-r--r-- | indra/llcommon/llworkerthread.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 4b91b2caca..e5eda1eac7 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -69,11 +69,11 @@ void LLWorkerThread::clearDeleteList() << " entries in delete list." << LL_ENDL; mDeleteMutex->lock(); - for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter) + for (LLWorkerClass* worker : mDeleteList) { - (*iter)->mRequestHandle = LLWorkerThread::nullHandle(); - (*iter)->clearFlags(LLWorkerClass::WCF_HAVE_WORK); - delete *iter ; + worker->mRequestHandle = LLWorkerThread::nullHandle(); + worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); + delete worker; } mDeleteList.clear() ; mDeleteMutex->unlock() ; @@ -81,9 +81,9 @@ void LLWorkerThread::clearDeleteList() } // virtual -S32 LLWorkerThread::update(F32 max_time_ms) +size_t LLWorkerThread::update(F32 max_time_ms) { - S32 res = LLQueuedThread::update(max_time_ms); + auto res = LLQueuedThread::update(max_time_ms); // Delete scheduled workers std::vector<LLWorkerClass*> delete_list; std::vector<LLWorkerClass*> abort_list; @@ -108,15 +108,12 @@ S32 LLWorkerThread::update(F32 max_time_ms) } mDeleteMutex->unlock(); // abort and delete after releasing mutex - for (std::vector<LLWorkerClass*>::iterator iter = abort_list.begin(); - iter != abort_list.end(); ++iter) + for (LLWorkerClass* worker : abort_list) { - (*iter)->abortWork(false); + worker->abortWork(false); } - for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin(); - iter != delete_list.end(); ++iter) + for (LLWorkerClass* worker : delete_list) { - LLWorkerClass* worker = *iter; if (worker->mRequestHandle) { // Finished but not completed @@ -124,7 +121,7 @@ S32 LLWorkerThread::update(F32 max_time_ms) worker->mRequestHandle = LLWorkerThread::nullHandle(); worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); } - delete *iter; + delete worker; } // delete and aborted entries mean there's still work to do res += delete_list.size() + abort_list.size(); |