Add proper locking around between threads shared variables and the calls to signal() and wait().

This commit is contained in:
Aleric Inglewood
2011-08-01 23:46:54 +02:00
parent 313e008f61
commit 13be594651
2 changed files with 16 additions and 10 deletions

View File

@@ -432,18 +432,8 @@ LLCondition::~LLCondition()
mAPRCondp = NULL;
}
void LLCondition::wait()
{
if (!isLocked())
{ //mAPRMutexp MUST be locked before calling apr_thread_cond_wait
apr_thread_mutex_lock(mAPRMutexp);
#if MUTEX_DEBUG
// avoid asserts on destruction in non-release builds
U32 id = LLThread::currentID();
mIsLocked[id] = TRUE;
#endif
}
apr_thread_cond_wait(mAPRCondp, mAPRMutexp);
}