Skip to content

Commit

Permalink
Remove global symbols: Avoid using the global namespace if possible
Browse files Browse the repository at this point in the history
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;
```
  • Loading branch information
practicalswift committed May 25, 2019
1 parent 63b9efa commit fb43415
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/httpserver.cpp
Expand Up @@ -139,15 +139,15 @@ struct HTTPPathHandler
//! libevent event loop
static struct event_base* eventBase = nullptr;
//! HTTP server
struct evhttp* eventHTTP = nullptr;
static struct evhttp* eventHTTP = nullptr;
//! List of subnets to allow RPC connections from
static std::vector<CSubNet> rpc_allow_subnets;
//! Work queue for handling longer requests off the event loop thread
static WorkQueue<HTTPClosure>* workQueue = nullptr;
//! Handlers for (sub)paths
std::vector<HTTPPathHandler> pathHandlers;
static std::vector<HTTPPathHandler> pathHandlers;
//! Bound listening sockets
std::vector<evhttp_bound_socket *> boundSockets;
static std::vector<evhttp_bound_socket *> boundSockets;

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

std::thread threadHTTP;
static std::thread threadHTTP;
static std::vector<std::thread> g_thread_http_workers;

void StartHTTPServer()
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Expand Up @@ -74,7 +74,7 @@
#include <zmq/zmqrpc.h>
#endif

bool fFeeEstimatesInitialized = false;
static bool fFeeEstimatesInitialized = false;
static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;
Expand Down
8 changes: 4 additions & 4 deletions src/warnings.cpp
Expand Up @@ -8,10 +8,10 @@
#include <util/system.h>
#include <warnings.h>

CCriticalSection cs_warnings;
std::string strMiscWarning GUARDED_BY(cs_warnings);
bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;
static RecursiveMutex cs_warnings;
static std::string strMiscWarning GUARDED_BY(cs_warnings);
static bool fLargeWorkForkFound GUARDED_BY(cs_warnings) = false;
static bool fLargeWorkInvalidChainFound GUARDED_BY(cs_warnings) = false;

void SetMiscWarning(const std::string& strWarning)
{
Expand Down

0 comments on commit fb43415

Please sign in to comment.