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-
This commit is contained in:
MarcoFalke
2020-02-21 09:20:51 -08:00
parent fa4620be78
commit fa9af06d91
11 changed files with 13 additions and 13 deletions

View File

@@ -29,7 +29,7 @@ static void WaitForShutdown(NodeContext& node)
{
while (!ShutdownRequested())
{
MilliSleep(200);
UninterruptibleSleep(std::chrono::milliseconds{200});
}
Interrupt(node);
}