mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-02 23:53:02 +02:00
refactor: Replace RecursiveMutex with Mutex in warnings.cpp
This commit is contained in:
@@ -9,32 +9,32 @@
|
|||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
|
|
||||||
static RecursiveMutex cs_warnings;
|
static Mutex g_warnings_mutex;
|
||||||
static std::string strMiscWarning GUARDED_BY(cs_warnings);
|
static std::string strMiscWarning GUARDED_BY(g_warnings_mutex);
|
||||||
static bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
|
static bool fLargeWorkForkFound GUARDED_BY(g_warnings_mutex) = false;
|
||||||
static bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;
|
static bool fLargeWorkInvalidChainFound GUARDED_BY(g_warnings_mutex) = false;
|
||||||
|
|
||||||
void SetMiscWarning(const std::string& strWarning)
|
void SetMiscWarning(const std::string& strWarning)
|
||||||
{
|
{
|
||||||
LOCK(cs_warnings);
|
LOCK(g_warnings_mutex);
|
||||||
strMiscWarning = strWarning;
|
strMiscWarning = strWarning;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetfLargeWorkForkFound(bool flag)
|
void SetfLargeWorkForkFound(bool flag)
|
||||||
{
|
{
|
||||||
LOCK(cs_warnings);
|
LOCK(g_warnings_mutex);
|
||||||
fLargeWorkForkFound = flag;
|
fLargeWorkForkFound = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GetfLargeWorkForkFound()
|
bool GetfLargeWorkForkFound()
|
||||||
{
|
{
|
||||||
LOCK(cs_warnings);
|
LOCK(g_warnings_mutex);
|
||||||
return fLargeWorkForkFound;
|
return fLargeWorkForkFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetfLargeWorkInvalidChainFound(bool flag)
|
void SetfLargeWorkInvalidChainFound(bool flag)
|
||||||
{
|
{
|
||||||
LOCK(cs_warnings);
|
LOCK(g_warnings_mutex);
|
||||||
fLargeWorkInvalidChainFound = flag;
|
fLargeWorkInvalidChainFound = flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ std::string GetWarnings(bool verbose)
|
|||||||
std::string warnings_verbose;
|
std::string warnings_verbose;
|
||||||
const std::string warning_separator = "<hr />";
|
const std::string warning_separator = "<hr />";
|
||||||
|
|
||||||
LOCK(cs_warnings);
|
LOCK(g_warnings_mutex);
|
||||||
|
|
||||||
// Pre-release build warning
|
// Pre-release build warning
|
||||||
if (!CLIENT_VERSION_IS_RELEASE) {
|
if (!CLIENT_VERSION_IS_RELEASE) {
|
||||||
|
Reference in New Issue
Block a user