From 126c8e371c4c90f23e5f28475cb9e57871e7e7be Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 2 Nov 2010 16:30:46 -0500 Subject: Make sure mutex is locked before waiting on a signal. Reviewed by Nyx. --- indra/llcommon/llthread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') 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); } -- cgit v1.2.3