Make sure that sRunning <= number of threads with status RUNNING.
This commit is contained in:
@@ -104,6 +104,11 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
|
||||
// the moment it happens... therefore make a copy here.
|
||||
char const* volatile name = threadp->mName.c_str();
|
||||
|
||||
// Always make sure that sRunning <= number of threads with status RUNNING,
|
||||
// so do this before changing mStatus (meaning that once we see that we
|
||||
// are STOPPED, then sRunning is also up to date).
|
||||
--sRunning;
|
||||
|
||||
// We're done with the run function, this thread is done executing now.
|
||||
threadp->mStatus = STOPPED;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user