HomePhabricator

[backport#16117] scripted-diff: Replace MilliSleep with UninterruptibleSleep

Description

[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

Details

Provenance
majcostaAuthored on Jun 10 2020, 22:57
majcostaPushed on Jun 11 2020, 00:48
Reviewer
Restricted Project
Differential Revision
D6518: [backport#16117] scripted-diff: Replace MilliSleep with UninterruptibleSleep
Parents
rABC4b5f81f8007b: [backport#16117] util: Add UnintrruptibleSleep
Branches
Unknown
Tags
Unknown