diff options
Diffstat (limited to 'linden/indra/llcommon/llthread.cpp')
-rw-r--r-- | linden/indra/llcommon/llthread.cpp | 63 |
1 files changed, 51 insertions, 12 deletions
diff --git a/linden/indra/llcommon/llthread.cpp b/linden/indra/llcommon/llthread.cpp index 290879d..d6b52f7 100644 --- a/linden/indra/llcommon/llthread.cpp +++ b/linden/indra/llcommon/llthread.cpp | |||
@@ -100,6 +100,11 @@ LLThread::LLThread(const std::string& name, apr_pool_t *poolp) : | |||
100 | 100 | ||
101 | LLThread::~LLThread() | 101 | LLThread::~LLThread() |
102 | { | 102 | { |
103 | shutdown(); | ||
104 | } | ||
105 | |||
106 | void LLThread::shutdown() | ||
107 | { | ||
103 | // Warning! If you somehow call the thread destructor from itself, | 108 | // Warning! If you somehow call the thread destructor from itself, |
104 | // the thread will die in an unclean fashion! | 109 | // the thread will die in an unclean fashion! |
105 | if (mAPRThreadp) | 110 | if (mAPRThreadp) |
@@ -205,18 +210,6 @@ void LLThread::checkPause() | |||
205 | 210 | ||
206 | //============================================================================ | 211 | //============================================================================ |
207 | 212 | ||
208 | bool LLThread::isQuitting() const | ||
209 | { | ||
210 | return (QUITTING == mStatus); | ||
211 | } | ||
212 | |||
213 | |||
214 | bool LLThread::isStopped() const | ||
215 | { | ||
216 | return (STOPPED == mStatus); | ||
217 | } | ||
218 | |||
219 | |||
220 | void LLThread::setQuitting() | 213 | void LLThread::setQuitting() |
221 | { | 214 | { |
222 | mRunCondition->lock(); | 215 | mRunCondition->lock(); |
@@ -347,3 +340,49 @@ void LLCondition::broadcast() | |||
347 | apr_thread_cond_broadcast(mAPRCondp); | 340 | apr_thread_cond_broadcast(mAPRCondp); |
348 | } | 341 | } |
349 | 342 | ||
343 | //============================================================================ | ||
344 | |||
345 | //---------------------------------------------------------------------------- | ||
346 | |||
347 | //static | ||
348 | LLMutex* LLThreadSafeRefCount::sMutex = 0; | ||
349 | |||
350 | //static | ||
351 | void LLThreadSafeRefCount::initClass() | ||
352 | { | ||
353 | if (!sMutex) | ||
354 | { | ||
355 | sMutex = new LLMutex(0); | ||
356 | } | ||
357 | } | ||
358 | |||
359 | //static | ||
360 | void LLThreadSafeRefCount::cleanupClass() | ||
361 | { | ||
362 | delete sMutex; | ||
363 | sMutex = NULL; | ||
364 | } | ||
365 | |||
366 | |||
367 | //---------------------------------------------------------------------------- | ||
368 | |||
369 | LLThreadSafeRefCount::LLThreadSafeRefCount() : | ||
370 | mRef(0) | ||
371 | { | ||
372 | } | ||
373 | |||
374 | LLThreadSafeRefCount::~LLThreadSafeRefCount() | ||
375 | { | ||
376 | if (mRef != 0) | ||
377 | { | ||
378 | llerrs << "deleting non-zero reference" << llendl; | ||
379 | } | ||
380 | } | ||
381 | |||
382 | //============================================================================ | ||
383 | |||
384 | LLResponder::~LLResponder() | ||
385 | { | ||
386 | } | ||
387 | |||
388 | //============================================================================ | ||