mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-15 22:02:51 -06:00
.Core: ShutdownThreads clarified
git-svn-id: svn://ultimatepp.org/upp/trunk@2482 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e3bc47a269
commit
e8dfb25502
1 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue