File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 2020#include < mutex>
2121#include < unordered_map>
2222
23- static RecursiveMutex cs_rpcWarmup ;
23+ static Mutex g_rpc_warmup_mutex ;
2424static std::atomic<bool > g_rpc_running{false };
25- static bool fRPCInWarmup GUARDED_BY (cs_rpcWarmup ) = true;
26- static std::string rpcWarmupStatus GUARDED_BY (cs_rpcWarmup ) = "RPC server started";
25+ static bool fRPCInWarmup GUARDED_BY (g_rpc_warmup_mutex ) = true;
26+ static std::string rpcWarmupStatus GUARDED_BY (g_rpc_warmup_mutex ) = "RPC server started";
2727/* Timer-creating functions */
2828static RPCTimerInterface* timerInterface = nullptr ;
2929/* Map of name to timer. */
@@ -327,20 +327,20 @@ void RpcInterruptionPoint()
327327
328328void SetRPCWarmupStatus (const std::string& newStatus)
329329{
330- LOCK (cs_rpcWarmup );
330+ LOCK (g_rpc_warmup_mutex );
331331 rpcWarmupStatus = newStatus;
332332}
333333
334334void SetRPCWarmupFinished ()
335335{
336- LOCK (cs_rpcWarmup );
336+ LOCK (g_rpc_warmup_mutex );
337337 assert (fRPCInWarmup );
338338 fRPCInWarmup = false ;
339339}
340340
341341bool RPCIsInWarmup (std::string *outStatus)
342342{
343- LOCK (cs_rpcWarmup );
343+ LOCK (g_rpc_warmup_mutex );
344344 if (outStatus)
345345 *outStatus = rpcWarmupStatus;
346346 return fRPCInWarmup ;
@@ -439,7 +439,7 @@ UniValue CRPCTable::execute(const JSONRPCRequest &request) const
439439{
440440 // Return immediately if in warmup
441441 {
442- LOCK (cs_rpcWarmup );
442+ LOCK (g_rpc_warmup_mutex );
443443 if (fRPCInWarmup )
444444 throw JSONRPCError (RPC_IN_WARMUP, rpcWarmupStatus);
445445 }
You can’t perform that action at this time.
0 commit comments