Add the rest of sRunning too.
This commit is contained in:
@@ -68,6 +68,7 @@ U32 ll_thread_local local_thread_ID = 0;
|
|||||||
|
|
||||||
U32 LLThread::sIDIter = 0;
|
U32 LLThread::sIDIter = 0;
|
||||||
LLAtomicS32 LLThread::sCount = 0;
|
LLAtomicS32 LLThread::sCount = 0;
|
||||||
|
LLAtomicS32 LLThread::sRunning = 0;
|
||||||
|
|
||||||
LL_COMMON_API void assert_main_thread()
|
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)].
|
// the critical area of the mSignal lock)].
|
||||||
lldebugs << "LLThread::staticRun() Exiting: " << name << llendl;
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,6 +196,7 @@ void LLThread::start()
|
|||||||
|
|
||||||
// Set thread state to running
|
// Set thread state to running
|
||||||
mStatus = RUNNING;
|
mStatus = RUNNING;
|
||||||
|
sRunning++;
|
||||||
|
|
||||||
apr_status_t status =
|
apr_status_t status =
|
||||||
apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, tldata().mRootPool());
|
apr_thread_create(&mAPRThreadp, NULL, staticRun, (void *)this, tldata().mRootPool());
|
||||||
@@ -205,6 +208,7 @@ void LLThread::start()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
--sRunning;
|
||||||
mStatus = STOPPED;
|
mStatus = STOPPED;
|
||||||
llwarns << "failed to start thread " << mName << llendl;
|
llwarns << "failed to start thread " << mName << llendl;
|
||||||
ll_apr_warn_status(status);
|
ll_apr_warn_status(status);
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class LL_COMMON_API LLThread
|
|||||||
private:
|
private:
|
||||||
static U32 sIDIter;
|
static U32 sIDIter;
|
||||||
static LLAtomicS32 sCount;
|
static LLAtomicS32 sCount;
|
||||||
|
static LLAtomicS32 sRunning;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef enum e_thread_status
|
typedef enum e_thread_status
|
||||||
@@ -96,6 +97,7 @@ public:
|
|||||||
|
|
||||||
static U32 currentID(); // Return ID of current thread
|
static U32 currentID(); // Return ID of current thread
|
||||||
static S32 getCount() { return sCount; }
|
static S32 getCount() { return sCount; }
|
||||||
|
static S32 getRunning() { return sRunning; }
|
||||||
static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
|
static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user