Skip to content

Commit a8705a1

Browse files
committed
scheduler: don't rely on boost interrupt on shutdown
>>> adapted from bitcoin/bitcoin@306f71b Calling interrupt_all() will immediately stop the scheduler, so it's safe to invoke stop() beforehand, and this removes the reliance on boost to interrupt serviceQueue().
1 parent 004c064 commit a8705a1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/init.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void PrepareShutdown()
241241

242242
// After everything has been shut down, but before things get flushed, stop the
243243
// CScheduler/checkqueue threadGroup
244+
scheduler.stop();
244245
threadGroup.interrupt_all();
245246
threadGroup.join_all();
246247

src/test/test_pivx.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
111111

112112
TestingSetup::~TestingSetup()
113113
{
114+
scheduler.stop();
114115
threadGroup.interrupt_all();
115116
threadGroup.join_all();
116117
GetMainSignals().FlushBackgroundCallbacks();

0 commit comments

Comments
 (0)