summaryrefslogtreecommitdiff
path: root/indra/llcommon/llworkerthread.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-05-17 11:17:48 -0700
committerBrad Linden <brad@lindenlab.com>2023-05-17 11:17:48 -0700
commit2f44377b3e98d60f1bd5b1a495c9a3aab9cfa450 (patch)
tree0c9b22edca280d8e2a2ef280360485c139c9b829 /indra/llcommon/llworkerthread.cpp
parent4758355c599d1487c11884d3f700981e011cb7b7 (diff)
parent5a70639b7992842a9f74ec81b11bac56608b8f2e (diff)
Merge remote-tracking branch 'origin/main' into DRTVWR-559
Diffstat (limited to 'indra/llcommon/llworkerthread.cpp')
-rw-r--r--indra/llcommon/llworkerthread.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp
index cd4d587752..06c74bdba0 100644
--- a/indra/llcommon/llworkerthread.cpp
+++ b/indra/llcommon/llworkerthread.cpp
@@ -69,12 +69,12 @@ 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);
- (*iter)->clearFlags(LLWorkerClass::WCF_WORKING);
- delete *iter ;
+ worker->mRequestHandle = LLWorkerThread::nullHandle();
+ worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK);
+ worker->clearFlags(LLWorkerClass::WCF_WORKING);
+ delete worker;
}
mDeleteList.clear() ;
mDeleteMutex->unlock() ;
@@ -82,9 +82,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;
@@ -110,15 +110,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
@@ -126,7 +123,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();