[skip ci] sync: Check precondition in LEAVE_CRITICAL_SECTION() macro

This change reveals a bug in the wallet_tests/CreateWalletFromFile test,
that will be fixed in the following commit.
This commit is contained in:
Hennadii Stepanov
2020-09-20 11:38:03 +03:00
parent c5e3e74f70
commit cb23fe01c1
2 changed files with 43 additions and 4 deletions

View File

@@ -242,10 +242,12 @@ using DebugLock = UniqueLock<typename std::remove_reference<typename std::remove
(cs).lock(); \
}
#define LEAVE_CRITICAL_SECTION(cs) \
{ \
(cs).unlock(); \
LeaveCritical(); \
#define LEAVE_CRITICAL_SECTION(cs) \
{ \
std::string lockname; \
CheckLastCritical((void*)(&cs), lockname, #cs, __FILE__, __LINE__); \
(cs).unlock(); \
LeaveCritical(); \
}
//! Run code while locking a mutex.