summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-11-02 16:30:46 -0500
committerDave Parks <davep@lindenlab.com>2010-11-02 16:30:46 -0500
commit126c8e371c4c90f23e5f28475cb9e57871e7e7be (patch)
tree7bbf0acad843d77cbc0a45c763a371070acd5d76 /indra/llcommon/llthread.cpp
parent7aff5c6ff9f951a9a15c035845d57801889442fa (diff)
Make sure mutex is locked before waiting on a signal.
Reviewed by Nyx.
Diffstat (limited to 'indra/llcommon/llthread.cpp')
-rw-r--r--indra/llcommon/llthread.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 9a33324129..59e28948f5 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -406,6 +406,10 @@ LLCondition::~LLCondition()
void LLCondition::wait()
{
+ if (!isLocked())
+ { //mAPRMutexp MUST be locked before calling apr_thread_cond_wait
+ apr_thread_mutex_lock(mAPRMutexp);
+ }
apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
}