mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Use scoped locks instead of CRITICAL_BLOCK
This commit is contained in:
parent
138d08c531
commit
f8dcd5ca6f
19 changed files with 286 additions and 190 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue