Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:
- update for RPC methods added since 84d13ee: setmocktime,
invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
the other two are thread safe.
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
6b5f5294bb
commit
4401b2d7c5
11
src/sync.h
11
src/sync.h
@@ -142,6 +142,17 @@ public:
|
||||
Enter(pszName, pszFile, nLine);
|
||||
}
|
||||
|
||||
CMutexLock(Mutex* pmutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false)
|
||||
{
|
||||
if (!pmutexIn) return;
|
||||
|
||||
lock = boost::unique_lock<Mutex>(*pmutexIn, boost::defer_lock);
|
||||
if (fTry)
|
||||
TryEnter(pszName, pszFile, nLine);
|
||||
else
|
||||
Enter(pszName, pszFile, nLine);
|
||||
}
|
||||
|
||||
~CMutexLock()
|
||||
{
|
||||
if (lock.owns_lock())
|
||||
|
||||
Reference in New Issue
Block a user