mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-03-11 05:03:31 +00:00
Fix infinite loop with LogPrint on Windows
Running -printtodebugger -debug (or -debug=lock), compiled with -DDEBUG_LOCKORDER would infinite loop on Windows because every critical section lock/unlock triggers a LogPrint. Solution is to use the raw boost mutex instead of a CCriticalSection.
This commit is contained in:
parent
955787f83f
commit
962b1cf441
@ -299,13 +299,11 @@ int LogPrint(const char* category, const char* pszFormat, ...)
|
||||
#ifdef WIN32
|
||||
if (fPrintToDebugger)
|
||||
{
|
||||
static CCriticalSection cs_OutputDebugStringF;
|
||||
|
||||
// accumulate and output a line at a time
|
||||
{
|
||||
LOCK(cs_OutputDebugStringF);
|
||||
static std::string buffer;
|
||||
|
||||
boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);
|
||||
|
||||
va_list arg_ptr;
|
||||
va_start(arg_ptr, pszFormat);
|
||||
buffer += vstrprintf(pszFormat, arg_ptr);
|
||||
@ -320,7 +318,6 @@ int LogPrint(const char* category, const char* pszFormat, ...)
|
||||
}
|
||||
buffer.erase(0, line_start);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user