File tree Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Expand file tree Collapse file tree 3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 22
22
23
23
static RecursiveMutex cs_rpcWarmup;
24
24
static std::atomic<bool > g_rpc_running{false };
25
- static std::once_flag g_rpc_interrupt_flag;
26
- static std::once_flag g_rpc_stop_flag;
27
25
static bool fRPCInWarmup GUARDED_BY (cs_rpcWarmup) = true;
28
26
static std::string rpcWarmupStatus GUARDED_BY (cs_rpcWarmup) = "RPC server started";
29
27
/* Timer-creating functions */
@@ -295,6 +293,7 @@ void StartRPC()
295
293
296
294
void InterruptRPC ()
297
295
{
296
+ static std::once_flag g_rpc_interrupt_flag;
298
297
// This function could be called twice if the GUI has been started with -server=1.
299
298
std::call_once (g_rpc_interrupt_flag, []() {
300
299
LogPrint (BCLog::RPC, " Interrupting RPC\n " );
@@ -305,6 +304,7 @@ void InterruptRPC()
305
304
306
305
void StopRPC ()
307
306
{
307
+ static std::once_flag g_rpc_stop_flag;
308
308
// This function could be called twice if the GUI has been started with -server=1.
309
309
assert (!g_rpc_running);
310
310
std::call_once (g_rpc_stop_flag, []() {
Original file line number Diff line number Diff line change 29
29
#endif
30
30
31
31
LockedPoolManager* LockedPoolManager::_instance = nullptr ;
32
- std::once_flag LockedPoolManager::init_flag;
33
32
34
33
/* ******************************************************************************/
35
34
// Utilities
Original file line number Diff line number Diff line change @@ -221,7 +221,8 @@ class LockedPoolManager : public LockedPool
221
221
/* * Return the current instance, or create it once */
222
222
static LockedPoolManager& Instance ()
223
223
{
224
- std::call_once (LockedPoolManager::init_flag, LockedPoolManager::CreateInstance);
224
+ static std::once_flag init_flag;
225
+ std::call_once (init_flag, LockedPoolManager::CreateInstance);
225
226
return *LockedPoolManager::_instance;
226
227
}
227
228
@@ -234,7 +235,6 @@ class LockedPoolManager : public LockedPool
234
235
static bool LockingFailed ();
235
236
236
237
static LockedPoolManager* _instance;
237
- static std::once_flag init_flag;
238
238
};
239
239
240
240
#endif // BITCOIN_SUPPORT_LOCKEDPOOL_H
You can’t perform that action at this time.
0 commit comments