Add the rest of sRunning too.

This commit is contained in:
Aleric Inglewood
2012-07-02 23:22:42 +02:00
parent 221e3908b9
commit d66acdf240
2 changed files with 7 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ U32 ll_thread_local local_thread_ID = 0;
U32 LLThread::sIDIter = 0;
LLAtomicS32 LLThread::sCount = 0;
LLAtomicS32 LLThread::sRunning = 0;
LL_COMMON_API void assert_main_thread()
{
@@ -119,6 +120,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
// the critical area of the mSignal lock)].
lldebugs << "LLThread::staticRun() Exiting: " << name << llendl;
--sRunning; // Would be better to do this after joining with the thread, but we don't join :/
return NULL;
}
@@ -194,6 +196,7 @@ void LLThread::start()
// Set thread state to running
mStatus = RUNNING;
sRunning++;
apr_status_t status =
apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, tldata().mRootPool());
@@ -205,6 +208,7 @@ void LLThread::start()
}
else
{
--sRunning;
mStatus = STOPPED;
llwarns << "failed to start thread " << mName << llendl;
ll_apr_warn_status(status);