mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-14 00:30:17 +02:00
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:
@@ -34,7 +34,7 @@ BOOST_FIXTURE_TEST_CASE(txindex_initial_sync, TestChain100Setup)
|
||||
int64_t time_start = GetTimeMillis();
|
||||
while (!txindex.BlockUntilSyncedToCurrentChain()) {
|
||||
BOOST_REQUIRE(time_start + timeout_ms > GetTimeMillis());
|
||||
MilliSleep(100);
|
||||
UninterruptibleSleep(std::chrono::milliseconds{100});
|
||||
}
|
||||
|
||||
// Check that txindex excludes genesis block transactions.
|
||||
|
||||
Reference in New Issue
Block a user