aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-04-17 20:22:41 -0700
committerMcCabe Maxsted2009-04-17 20:22:41 -0700
commit8bc9d12fcc07e888c10cd0746d2a562c09d3a65a (patch)
tree145a6baf1e5456ca6e289f879ab6325e46161b0a /linden/indra/llcommon
parentFixed merge conflicts (diff)
parentDon't use LL_ERRS, it makes the viewer abort! (diff)
downloadmeta-impy-8bc9d12fcc07e888c10cd0746d2a562c09d3a65a.zip
meta-impy-8bc9d12fcc07e888c10cd0746d2a562c09d3a65a.tar.gz
meta-impy-8bc9d12fcc07e888c10cd0746d2a562c09d3a65a.tar.bz2
meta-impy-8bc9d12fcc07e888c10cd0746d2a562c09d3a65a.tar.xz
Merge commit 'jacek/next' into gst-revamp
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r--linden/indra/llcommon/llerror.cpp6
-rw-r--r--linden/indra/llcommon/llthread.cpp10
-rw-r--r--linden/indra/llcommon/llthread.h8
3 files changed, 11 insertions, 13 deletions
diff --git a/linden/indra/llcommon/llerror.cpp b/linden/indra/llcommon/llerror.cpp
index 5c7c3cd..b95b325 100644
--- a/linden/indra/llcommon/llerror.cpp
+++ b/linden/indra/llcommon/llerror.cpp
@@ -902,7 +902,7 @@ namespace {
902 return; 902 return;
903 } 903 }
904 904
905 const int MAX_RETRIES = 5; 905 const int MAX_RETRIES = 10;
906 for (int attempts = 0; attempts < MAX_RETRIES; ++attempts) 906 for (int attempts = 0; attempts < MAX_RETRIES; ++attempts)
907 { 907 {
908 apr_status_t s = apr_thread_mutex_trylock(gLogMutexp); 908 apr_status_t s = apr_thread_mutex_trylock(gLogMutexp);
@@ -914,9 +914,7 @@ namespace {
914 } 914 }
915 915
916 ms_sleep(1); 916 ms_sleep(1);
917 //apr_thread_yield(); 917 apr_thread_yield();
918 // Just yielding won't necessarily work, I had problems with
919 // this on Linux - doug 12/02/04
920 } 918 }
921 919
922 // We're hosed, we can't get the mutex. Blah. 920 // We're hosed, we can't get the mutex. Blah.
diff --git a/linden/indra/llcommon/llthread.cpp b/linden/indra/llcommon/llthread.cpp
index 822adc2..4879d58 100644
--- a/linden/indra/llcommon/llthread.cpp
+++ b/linden/indra/llcommon/llthread.cpp
@@ -84,7 +84,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
84 84
85 85
86LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : 86LLThread::LLThread(const std::string& name, apr_pool_t *poolp) :
87 mPaused(FALSE), 87 mPaused(false),
88 mName(name), 88 mName(name),
89 mAPRThreadp(NULL), 89 mAPRThreadp(NULL),
90 mStatus(STOPPED) 90 mStatus(STOPPED)
@@ -92,12 +92,12 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) :
92 // Thread creation probably CAN be paranoid about APR being initialized, if necessary 92 // Thread creation probably CAN be paranoid about APR being initialized, if necessary
93 if (poolp) 93 if (poolp)
94 { 94 {
95 mIsLocalPool = FALSE; 95 mIsLocalPool = false;
96 mAPRPoolp = poolp; 96 mAPRPoolp = poolp;
97 } 97 }
98 else 98 else
99 { 99 {
100 mIsLocalPool = TRUE; 100 mIsLocalPool = true;
101 apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread 101 apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread
102 } 102 }
103 mRunCondition = new LLCondition(mAPRPoolp); 103 mRunCondition = new LLCondition(mAPRPoolp);
@@ -268,12 +268,12 @@ LLMutex::LLMutex(apr_pool_t *poolp) :
268{ 268{
269 //if (poolp) 269 //if (poolp)
270 //{ 270 //{
271 // mIsLocalPool = FALSE; 271 // mIsLocalPool = false;
272 // mAPRPoolp = poolp; 272 // mAPRPoolp = poolp;
273 //} 273 //}
274 //else 274 //else
275 { 275 {
276 mIsLocalPool = TRUE; 276 mIsLocalPool = true;
277 apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread 277 apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread
278 } 278 }
279 apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp); 279 apr_thread_mutex_create(&mAPRMutexp, APR_THREAD_MUTEX_UNNESTED, mAPRPoolp);
diff --git a/linden/indra/llcommon/llthread.h b/linden/indra/llcommon/llthread.h
index 9da3134..a0b22f2 100644
--- a/linden/indra/llcommon/llthread.h
+++ b/linden/indra/llcommon/llthread.h
@@ -67,7 +67,7 @@ public:
67 // Called from MAIN THREAD. 67 // Called from MAIN THREAD.
68 void pause(); 68 void pause();
69 void unpause(); 69 void unpause();
70 bool isPaused() { return isStopped() || mPaused == TRUE; } 70 bool isPaused() { return isStopped() || mPaused; }
71 71
72 // Cause the thread to wake up and check its condition 72 // Cause the thread to wake up and check its condition
73 void wake(); 73 void wake();
@@ -84,7 +84,7 @@ public:
84 apr_pool_t *getAPRPool() { return mAPRPoolp; } 84 apr_pool_t *getAPRPool() { return mAPRPoolp; }
85 85
86private: 86private:
87 BOOL mPaused; 87 bool mPaused;
88 88
89 // static function passed to APR thread creation routine 89 // static function passed to APR thread creation routine
90 static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap); 90 static void *APR_THREAD_FUNC staticRun(apr_thread_t *apr_threadp, void *datap);
@@ -95,7 +95,7 @@ protected:
95 95
96 apr_thread_t *mAPRThreadp; 96 apr_thread_t *mAPRThreadp;
97 apr_pool_t *mAPRPoolp; 97 apr_pool_t *mAPRPoolp;
98 BOOL mIsLocalPool; 98 bool mIsLocalPool;
99 EThreadStatus mStatus; 99 EThreadStatus mStatus;
100 100
101 void setQuitting(); 101 void setQuitting();
@@ -137,7 +137,7 @@ public:
137protected: 137protected:
138 apr_thread_mutex_t *mAPRMutexp; 138 apr_thread_mutex_t *mAPRMutexp;
139 apr_pool_t *mAPRPoolp; 139 apr_pool_t *mAPRPoolp;
140 BOOL mIsLocalPool; 140 bool mIsLocalPool;
141}; 141};
142 142
143// Actually a condition/mutex pair (since each condition needs to be associated with a mutex). 143// Actually a condition/mutex pair (since each condition needs to be associated with a mutex).