diff options
| author | Gavin Andresen <[email protected]> | 2014-02-18 12:11:46 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2014-02-18 12:11:46 -0500 |
| commit | ca4cf5cff6fb60c9769b62acce2e3a8fcd0e7aae (patch) | |
| tree | 87a92041e1d394ad06d8506be036973f5b5e0fd4 /src/sync.cpp | |
| parent | Merge pull request #3693 (diff) | |
| download | discoin-ca4cf5cff6fb60c9769b62acce2e3a8fcd0e7aae.tar.xz discoin-ca4cf5cff6fb60c9769b62acce2e3a8fcd0e7aae.zip | |
Wallet locking fixes for -DDEBUG_LOCKORDER
Compiling with -DDEBUG_LOCKORDER and running the qa/rpc-test/ regression
tests uncovered a couple of wallet methods that should (but didn't)
acquire the cs_wallet mutext.
I also changed the AssertLockHeld() routine print to stderr and
abort, instead of printing to debug.log and then assert()'ing.
It is annoying to look in debug.log to find out which
AssertLockHeld is failing.
Diffstat (limited to 'src/sync.cpp')
| -rw-r--r-- | src/sync.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sync.cpp b/src/sync.cpp index 8f713807f..e624a9ee8 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -140,8 +140,9 @@ void AssertLockHeldInternal(const char *pszName, const char* pszFile, int nLine, { BOOST_FOREACH(const PAIRTYPE(void*, CLockLocation)&i, *lockstack) if (i.first == cs) return; - LogPrintf("Lock %s not held in %s:%i; locks held:\n%s", pszName, pszFile, nLine, LocksHeld()); - assert(0); + fprintf(stderr, "Assertion failed: lock %s not held in %s:%i; locks held:\n%s", + pszName, pszFile, nLine, LocksHeld().c_str()); + abort(); } #endif /* DEBUG_LOCKORDER */ |