Skip to content

Commit bba87c0

Browse files
committed
scripted-diff: Convert global Mutexes to GlobalMutexes
-BEGIN VERIFY SCRIPT- sed -i -E -e '/^([a-z]+ )?Mutex [a-z]/ s/Mutex/GlobalMutex/' $(git grep -lE '^([a-z]+ )?Mutex [a-z]') -END VERIFY SCRIPT-
1 parent a559509 commit bba87c0

File tree

13 files changed

+15
-15
lines changed

13 files changed

+15
-15
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ void SetupServerArgs(ArgsManager& argsman)
600600
}
601601

602602
static bool fHaveGenesis = false;
603-
static Mutex g_genesis_wait_mutex;
603+
static GlobalMutex g_genesis_wait_mutex;
604604
static std::condition_variable g_genesis_wait_cv;
605605

606606
static void BlockNotifyGenesisWait(const CBlockIndex* pBlockIndex)

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static const uint64_t RANDOMIZER_ID_ADDRCACHE = 0x1cf2e4ddd306dda9ULL; // SHA256
113113
//
114114
bool fDiscover = true;
115115
bool fListen = true;
116-
Mutex g_maplocalhost_mutex;
116+
GlobalMutex g_maplocalhost_mutex;
117117
std::map<CNetAddr, LocalServiceInfo> mapLocalHost GUARDED_BY(g_maplocalhost_mutex);
118118
static bool vfLimited[NET_MAX] GUARDED_BY(g_maplocalhost_mutex) = {};
119119
std::string strSubVersion;

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ struct LocalServiceInfo {
248248
uint16_t nPort;
249249
};
250250

251-
extern Mutex g_maplocalhost_mutex;
251+
extern GlobalMutex g_maplocalhost_mutex;
252252
extern std::map<CNetAddr, LocalServiceInfo> mapLocalHost GUARDED_BY(g_maplocalhost_mutex);
253253

254254
extern const std::string NET_MESSAGE_TYPE_OTHER;

src/netbase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#endif
3131

3232
// Settings
33-
static Mutex g_proxyinfo_mutex;
33+
static GlobalMutex g_proxyinfo_mutex;
3434
static Proxy proxyInfo[NET_MAX] GUARDED_BY(g_proxyinfo_mutex);
3535
static Proxy nameProxy GUARDED_BY(g_proxyinfo_mutex);
3636
int nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct CUpdatedBlock
6666
int height;
6767
};
6868

69-
static Mutex cs_blockchange;
69+
static GlobalMutex cs_blockchange;
7070
static std::condition_variable cond_blockchange;
7171
static CUpdatedBlock latestblock GUARDED_BY(cs_blockchange);
7272

src/rpc/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#include <mutex>
2020
#include <unordered_map>
2121

22-
static Mutex g_rpc_warmup_mutex;
22+
static GlobalMutex g_rpc_warmup_mutex;
2323
static std::atomic<bool> g_rpc_running{false};
2424
static bool fRPCInWarmup GUARDED_BY(g_rpc_warmup_mutex) = true;
2525
static std::string rpcWarmupStatus GUARDED_BY(g_rpc_warmup_mutex) = "RPC server started";
2626
/* Timer-creating functions */
2727
static RPCTimerInterface* timerInterface = nullptr;
2828
/* Map of name to timer. */
29-
static Mutex g_deadline_timers_mutex;
29+
static GlobalMutex g_deadline_timers_mutex;
3030
static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers GUARDED_BY(g_deadline_timers_mutex);
3131
static bool ExecuteCommand(const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler);
3232

src/timedata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <util/translation.h>
1717
#include <warnings.h>
1818

19-
static Mutex g_timeoffset_mutex;
19+
static GlobalMutex g_timeoffset_mutex;
2020
static int64_t nTimeOffset GUARDED_BY(g_timeoffset_mutex) = 0;
2121

2222
/**

src/util/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const char * const BITCOIN_SETTINGS_FILENAME = "settings.json";
9696
ArgsManager gArgs;
9797

9898
/** Mutex to protect dir_locks. */
99-
static Mutex cs_dir_locks;
99+
static GlobalMutex cs_dir_locks;
100100
/** A map that contains all the currently held directory locks. After
101101
* successful locking, these will be held here until the global destructor
102102
* cleans them up and thus automatically unlocks them, or ReleaseDirectoryLocks

src/validation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static constexpr int PRUNE_LOCK_BUFFER{10};
122122
*/
123123
RecursiveMutex cs_main;
124124

125-
Mutex g_best_block_mutex;
125+
GlobalMutex g_best_block_mutex;
126126
std::condition_variable g_best_block_cv;
127127
uint256 g_best_block;
128128
bool g_parallel_script_checks{false};

src/validation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ enum class SynchronizationState {
114114
};
115115

116116
extern RecursiveMutex cs_main;
117-
extern Mutex g_best_block_mutex;
117+
extern GlobalMutex g_best_block_mutex;
118118
extern std::condition_variable g_best_block_cv;
119119
/** Used to notify getblocktemplate RPC of new tips. */
120120
extern uint256 g_best_block;

0 commit comments

Comments
 (0)