From fa9af06d91e9357e86863781746f0e78a509967e Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 21 Feb 2020 09:20:51 -0800 Subject: scripted-diff: Replace MilliSleep with UninterruptibleSleep This is safe because MilliSleep is never executed in a boost::thread, the only type of thread that is interruptible. * The RPC server uses std::thread * The wallet is either executed in an RPC thread or the main thread * bitcoin-cli, benchmarks and tests are only one thread (the main thread) -BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/MilliSleep\((\S+)\);/UninterruptibleSleep(std::chrono::milliseconds{\1});/g' $(git grep -l MilliSleep) -END VERIFY SCRIPT- --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4b5cea4849..e284dce0d5 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -29,7 +29,7 @@ static void WaitForShutdown(NodeContext& node) { while (!ShutdownRequested()) { - MilliSleep(200); + UninterruptibleSleep(std::chrono::milliseconds{200}); } Interrupt(node); } -- cgit v1.2.3