Skip to content

Commit bacbfb6

Browse files
committed
refactor: Replace RecursiveMutex with Mutex in warnings.cpp
1 parent a79bca2 commit bacbfb6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/warnings.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@
99
#include <util/system.h>
1010
#include <util/translation.h>
1111

12-
static RecursiveMutex cs_warnings;
13-
static std::string strMiscWarning GUARDED_BY(cs_warnings);
14-
static bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
15-
static bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;
12+
static Mutex g_warnings_mutex;
13+
static std::string strMiscWarning GUARDED_BY(g_warnings_mutex);
14+
static bool fLargeWorkForkFound GUARDED_BY(g_warnings_mutex) = false;
15+
static bool fLargeWorkInvalidChainFound GUARDED_BY(g_warnings_mutex) = false;
1616

1717
void SetMiscWarning(const std::string& strWarning)
1818
{
19-
LOCK(cs_warnings);
19+
LOCK(g_warnings_mutex);
2020
strMiscWarning = strWarning;
2121
}
2222

2323
void SetfLargeWorkForkFound(bool flag)
2424
{
25-
LOCK(cs_warnings);
25+
LOCK(g_warnings_mutex);
2626
fLargeWorkForkFound = flag;
2727
}
2828

2929
bool GetfLargeWorkForkFound()
3030
{
31-
LOCK(cs_warnings);
31+
LOCK(g_warnings_mutex);
3232
return fLargeWorkForkFound;
3333
}
3434

3535
void SetfLargeWorkInvalidChainFound(bool flag)
3636
{
37-
LOCK(cs_warnings);
37+
LOCK(g_warnings_mutex);
3838
fLargeWorkInvalidChainFound = flag;
3939
}
4040

@@ -44,7 +44,7 @@ std::string GetWarnings(bool verbose)
4444
std::string warnings_verbose;
4545
const std::string warning_separator = "<hr />";
4646

47-
LOCK(cs_warnings);
47+
LOCK(g_warnings_mutex);
4848

4949
// Pre-release build warning
5050
if (!CLIENT_VERSION_IS_RELEASE) {

0 commit comments

Comments
 (0)