Skip to content

Commit 004f999

Browse files
committed
boost: drop boost threads for [alert|block|wallet]notify
1 parent 0827267 commit 004f999

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex
546546
std::string strCmd = gArgs.GetArg("-blocknotify", "");
547547
if (!strCmd.empty()) {
548548
boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex());
549-
boost::thread t(runCommand, strCmd); // thread runs free
549+
std::thread t(runCommand, strCmd);
550+
t.detach(); // thread runs free
550551
}
551552
}
552553

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,8 @@ static void AlertNotify(const std::string& strMessage)
11881188
safeStatus = singleQuote+safeStatus+singleQuote;
11891189
boost::replace_all(strCmd, "%s", safeStatus);
11901190

1191-
boost::thread t(runCommand, strCmd); // thread runs free
1191+
std::thread t(runCommand, strCmd);
1192+
t.detach(); // thread runs free
11921193
}
11931194

11941195
static void CheckForkWarningConditions()

src/wallet/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <future>
3535

3636
#include <boost/algorithm/string/replace.hpp>
37-
#include <boost/thread.hpp>
3837

3938
std::vector<CWalletRef> vpwallets;
4039
/** Transaction fee set by the user */
@@ -976,7 +975,8 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)
976975
if (!strCmd.empty())
977976
{
978977
boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
979-
boost::thread t(runCommand, strCmd); // thread runs free
978+
std::thread t(runCommand, strCmd);
979+
t.detach(); // thread runs free
980980
}
981981

982982
return true;

0 commit comments

Comments
 (0)