Use scoped locks instead of CRITICAL_BLOCK

This commit is contained in:
Pieter Wuille
2012-04-06 18:39:12 +02:00
parent 138d08c531
commit f8dcd5ca6f
19 changed files with 286 additions and 190 deletions

View File

@@ -40,10 +40,13 @@ void Shutdown(void* parg)
static CCriticalSection cs_Shutdown;
static bool fTaken;
bool fFirstThread = false;
TRY_CRITICAL_BLOCK(cs_Shutdown)
{
fFirstThread = !fTaken;
fTaken = true;
TRY_LOCK(cs_Shutdown, lockShutdown);
if (lockShutdown)
{
fFirstThread = !fTaken;
fTaken = true;
}
}
static bool fExit;
if (fFirstThread)