aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-04-06 18:39:12 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-04-09 01:59:46 +0200
commitf8dcd5ca6f55ad49807cf7491c1f153f6158400e (patch)
tree6049e300099aa5f509e408acfff0236367b4a26e /src/init.cpp
parent138d08c5315c45b3dd08184c4eeb77ee3e47ef0a (diff)
Use scoped locks instead of CRITICAL_BLOCK
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 3f900fc872..a1e45b1c6b 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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)