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

@@ -15,14 +15,15 @@ BOOST_AUTO_TEST_CASE(util_criticalsection)
CCriticalSection cs;
do {
CRITICAL_BLOCK(cs)
break;
LOCK(cs);
break;
BOOST_ERROR("break was swallowed!");
} while(0);
do {
TRY_CRITICAL_BLOCK(cs)
TRY_LOCK(cs, lockTest);
if (lockTest)
break;
BOOST_ERROR("break was swallowed!");