.Core: ShutdownThreads clarified

git-svn-id: svn://ultimatepp.org/upp/trunk@2482 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-06-13 15:53:29 +00:00
parent e3bc47a269
commit e8dfb25502

View file

@ -170,19 +170,19 @@ int Thread::GetCount()
return ReadWithBarrier(sThreadCount);
}
static Atomic sShutdown;
static volatile Atomic sShutdown = 0;
void Thread::ShutdownThreads()
{
AtomicInc(sShutdown);
while(sThreadCount)
while(AtomicRead(sThreadCount))
Sleep(100);
AtomicDec(sShutdown);
}
bool Thread::IsShutdownThreads()
{
return sShutdown;
return AtomicRead(sShutdown);
}
int Thread::Wait()