[backport#16117] scripted-diff: Replace MilliSleep with UninterruptibleSleep
Summary:
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-
https://github.com/bitcoin/bitcoin/pull/16117/commits/fa9af06d91e9357e86863781746f0e78a509967e
Depends on D6517
Partial backport of Core PR16117
Test Plan:
ninja check-all
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D6518