Page MenuHomePhabricator

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

Authored by majcosta on Jun 10 2020, 23:49.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Jun 11 2020, 00:16