diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-02-21 09:20:51 -0800 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-02-21 10:06:21 -0800 |
commit | fa9af06d91e9357e86863781746f0e78a509967e (patch) | |
tree | 84da5bbd0c028648b9ec383dabc80849d2f15d18 /src/wallet/db.cpp | |
parent | fa4620be782c2bf6b5ffddf4f671194fdd1536f3 (diff) | |
download | bitcoin-fa9af06d91e9357e86863781746f0e78a509967e.tar.xz |
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-
Diffstat (limited to 'src/wallet/db.cpp')
-rw-r--r-- | src/wallet/db.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 8b042162d8..aa6e91c05e 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -756,7 +756,7 @@ bool BerkeleyBatch::Rewrite(BerkeleyDatabase& database, const char* pszSkip) return fSuccess; } } - MilliSleep(100); + UninterruptibleSleep(std::chrono::milliseconds{100}); } } @@ -887,7 +887,7 @@ bool BerkeleyDatabase::Backup(const std::string& strDest) } } } - MilliSleep(100); + UninterruptibleSleep(std::chrono::milliseconds{100}); } } |