aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon/llworkerthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcommon/llworkerthread.cpp')
-rw-r--r--linden/indra/llcommon/llworkerthread.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/linden/indra/llcommon/llworkerthread.cpp b/linden/indra/llcommon/llworkerthread.cpp
index 96a957b..5dda600 100644
--- a/linden/indra/llcommon/llworkerthread.cpp
+++ b/linden/indra/llcommon/llworkerthread.cpp
@@ -16,7 +16,8 @@
16 * There are special exceptions to the terms and conditions of the GPL as 16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception 17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or 18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 19 * online at
20 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
20 * 21 *
21 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -36,16 +37,18 @@
36#include "llframecallbackmanager.h" 37#include "llframecallbackmanager.h"
37#endif 38#endif
38 39
39BOOL LLWorkerClass::sDeleteLock = FALSE ;
40//============================================================================ 40//============================================================================
41// Run on MAIN thread 41// Run on MAIN thread
42 42
43LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) : 43LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) :
44 LLQueuedThread(name, threaded), 44 LLQueuedThread(name, threaded)
45 mWorkerAPRPoolp(NULL)
46{ 45{
47 apr_pool_create(&mWorkerAPRPoolp, NULL); 46 mDeleteMutex = new LLMutex(NULL);
48 mDeleteMutex = new LLMutex(getAPRPool()); 47
48 if(!mLocalAPRFilePoolp)
49 {
50 mLocalAPRFilePoolp = new LLVolatileAPRPool() ;
51 }
49} 52}
50 53
51LLWorkerThread::~LLWorkerThread() 54LLWorkerThread::~LLWorkerThread()
@@ -95,7 +98,6 @@ S32 LLWorkerThread::update(U32 max_time_ms)
95 { 98 {
96 (*iter)->abortWork(false); 99 (*iter)->abortWork(false);
97 } 100 }
98 LLWorkerClass::sDeleteLock = TRUE ;
99 for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin(); 101 for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin();
100 iter != delete_list.end(); ++iter) 102 iter != delete_list.end(); ++iter)
101 { 103 {
@@ -109,8 +111,7 @@ S32 LLWorkerThread::update(U32 max_time_ms)
109 } 111 }
110 delete *iter; 112 delete *iter;
111 } 113 }
112 LLWorkerClass::sDeleteLock = FALSE ; 114 // delete and aborted entries mean there's still work to do
113 // delete and aborted entries mean there's still work to do
114 res += delete_list.size() + abort_list.size(); 115 res += delete_list.size() + abort_list.size();
115 return res; 116 return res;
116} 117}
@@ -187,7 +188,7 @@ LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& na
187 : mWorkerThread(workerthread), 188 : mWorkerThread(workerthread),
188 mWorkerClassName(name), 189 mWorkerClassName(name),
189 mRequestHandle(LLWorkerThread::nullHandle()), 190 mRequestHandle(LLWorkerThread::nullHandle()),
190 mMutex(workerthread->getWorkerAPRPool()), 191 mMutex(NULL),
191 mWorkFlags(0) 192 mWorkFlags(0)
192{ 193{
193 if (!mWorkerThread) 194 if (!mWorkerThread)