From 004f9999464c7ef4a57b281dcbb407e5d193e798 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 7 Feb 2018 19:19:34 -0500 Subject: [PATCH] boost: drop boost threads for [alert|block|wallet]notify --- src/init.cpp | 3 ++- src/validation.cpp | 3 ++- src/wallet/wallet.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 9f61989a2..ec2edd9ca 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -546,7 +546,8 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex std::string strCmd = gArgs.GetArg("-blocknotify", ""); if (!strCmd.empty()) { boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free + std::thread t(runCommand, strCmd); + t.detach(); // thread runs free } } diff --git a/src/validation.cpp b/src/validation.cpp index 16b656c7f..6b02c0920 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1188,7 +1188,8 @@ static void AlertNotify(const std::string& strMessage) safeStatus = singleQuote+safeStatus+singleQuote; boost::replace_all(strCmd, "%s", safeStatus); - boost::thread t(runCommand, strCmd); // thread runs free + std::thread t(runCommand, strCmd); + t.detach(); // thread runs free } static void CheckForkWarningConditions() diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2b8019395..3b8ecce6d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -34,7 +34,6 @@ #include #include -#include std::vector vpwallets; /** Transaction fee set by the user */ @@ -976,7 +975,8 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose) if (!strCmd.empty()) { boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free + std::thread t(runCommand, strCmd); + t.detach(); // thread runs free } return true;