Skip to content

Commit fb43415

Browse files
Remove global symbols: Avoid using the global namespace if possible
Rename CCriticalSection to RecursiveMutex (both are AnnotatedMixin<std::recursive_mutex>) ``` $ git grep -E '(typedef|using).*(CCriticalSection|RecursiveMutex)' src/sync.h:using RecursiveMutex = AnnotatedMixin<std::recursive_mutex>; src/sync.h:typedef AnnotatedMixin<std::recursive_mutex> CCriticalSection; ```
1 parent 63b9efa commit fb43415

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/httpserver.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ struct HTTPPathHandler
139139
//! libevent event loop
140140
static struct event_base* eventBase = nullptr;
141141
//! HTTP server
142-
struct evhttp* eventHTTP = nullptr;
142+
static struct evhttp* eventHTTP = nullptr;
143143
//! List of subnets to allow RPC connections from
144144
static std::vector<CSubNet> rpc_allow_subnets;
145145
//! Work queue for handling longer requests off the event loop thread
146146
static WorkQueue<HTTPClosure>* workQueue = nullptr;
147147
//! Handlers for (sub)paths
148-
std::vector<HTTPPathHandler> pathHandlers;
148+
static std::vector<HTTPPathHandler> pathHandlers;
149149
//! Bound listening sockets
150-
std::vector<evhttp_bound_socket *> boundSockets;
150+
static std::vector<evhttp_bound_socket *> boundSockets;
151151

152152
/** Check if a network address is allowed to access the HTTP server */
153153
static bool ClientAllowed(const CNetAddr& netaddr)
@@ -420,7 +420,7 @@ bool UpdateHTTPServerLogging(bool enable) {
420420
#endif
421421
}
422422

423-
std::thread threadHTTP;
423+
static std::thread threadHTTP;
424424
static std::vector<std::thread> g_thread_http_workers;
425425

426426
void StartHTTPServer()

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
#include <zmq/zmqrpc.h>
7575
#endif
7676

77-
bool fFeeEstimatesInitialized = false;
77+
static bool fFeeEstimatesInitialized = false;
7878
static const bool DEFAULT_PROXYRANDOMIZE = true;
7979
static const bool DEFAULT_REST_ENABLE = false;
8080
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;

src/warnings.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#include <util/system.h>
99
#include <warnings.h>
1010

11-
CCriticalSection cs_warnings;
12-
std::string strMiscWarning GUARDED_BY(cs_warnings);
13-
bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
14-
bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;
11+
static RecursiveMutex cs_warnings;
12+
static std::string strMiscWarning GUARDED_BY(cs_warnings);
13+
static bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
14+
static bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;
1515

1616
void SetMiscWarning(const std::string& strWarning)
1717
{

0 commit comments

Comments
 (0)