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

13 files changed

+15
-15
lines changed

src/init.cpp

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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;

src/wallet/sqlite.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
namespace wallet {
2424
static constexpr int32_t WALLET_SCHEMA_VERSION = 0;
2525

26-
static Mutex g_sqlite_mutex;
26+
static GlobalMutex g_sqlite_mutex;
2727
static int g_sqlite_count GUARDED_BY(g_sqlite_mutex) = 0;
2828

2929
static void ErrorLogCallback(void* arg, int code, const char* msg)

src/wallet/wallet.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ void NotifyWalletLoaded(WalletContext& context, const std::shared_ptr<CWallet>&
173173
}
174174
}
175175

176-
static Mutex g_loading_wallet_mutex;
177-
static Mutex g_wallet_release_mutex;
176+
static GlobalMutex g_loading_wallet_mutex;
177+
static GlobalMutex g_wallet_release_mutex;
178178
static std::condition_variable g_wallet_release_cv;
179179
static std::set<std::string> g_loading_wallet_set GUARDED_BY(g_loading_wallet_mutex);
180180
static std::set<std::string> g_unloading_wallet_set GUARDED_BY(g_wallet_release_mutex);

src/warnings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <vector>
1414

15-
static Mutex g_warnings_mutex;
15+
static GlobalMutex g_warnings_mutex;
1616
static bilingual_str g_misc_warnings GUARDED_BY(g_warnings_mutex);
1717
static bool fLargeWorkInvalidChainFound GUARDED_BY(g_warnings_mutex) = false;
1818

0 commit comments

Comments
 (0)