diff options
author | fanquake <fanquake@gmail.com> | 2020-06-02 22:09:50 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-06-02 22:35:03 +0800 |
commit | 5879bfa9a541576100d939d329a2639b79d9e4f9 (patch) | |
tree | e49d3a9dfb7878c63f6ba6d980a24ea0629e42af /src/wallet/db.cpp | |
parent | 9e8bd217cd2a3437ce7c8fc7f04a61a3aee5268c (diff) | |
parent | fa1c74fd0342b74d44cc4e41fff3890c1434e8f7 (diff) | |
download | bitcoin-5879bfa9a541576100d939d329a2639b79d9e4f9.tar.xz |
Merge #18792: wallet: Remove boost from PeriodicFlush
fa1c74fd0342b74d44cc4e41fff3890c1434e8f7 wallet: Remove unused boost::thread_interrupted (MarcoFalke)
fa7b885f51ff848d3f913bc6e15d24528300c210 walletdb: Remove unsed boost/thread (MarcoFalke)
5555d978b056ab0e0e59faaf2d2067ec43fffaef wallet: Make PeriodicFlush uninterruptible (MarcoFalke)
Pull request description:
The `boost::this_thread::interruption_point()` in the code base currently block the replacement of `boost::thread` with `std::thread`. [1]
Remove them from the wallet because they are either unused or useless.
The feature to interrupt a periodic flush is useless because all wallets have just been flushed https://github.com/bitcoin/bitcoin/blob/9ccaee1d5e2e4b79b0a7c29aadb41b97e4741332/src/init.cpp#L194 and another flush should be a noop. Also, they will be flushed again shortly after https://github.com/bitcoin/bitcoin/blob/9ccaee1d5e2e4b79b0a7c29aadb41b97e4741332/src/init.cpp#L285, so even if repeated flushes weren't a noop, doing 3 instead of 2 shouldn't matter too much at this point. Also, the wallet is flushed every two seconds in the worst case, so if this is an expensive operation, that period should be readjusted. (Or bdb should be removed altogether #18916)
[1] Replacement of `boost::thread` with `std::thread` should happen because:
* The boost thread dependency is slow to compile
* Boost thread is less maintained than the standard lib
* Boost thread is mostly redundant to the standard lib
* Global interruption points via exceptions are hard to keep track of during review and easy to get wrong during runtime (e.g. accidental `catch (...)`)
ACKs for top commit:
fanquake:
ACK fa1c74fd0342b74d44cc4e41fff3890c1434e8f7
Tree-SHA512: b166619256de2ef4325480fa1367f68bc9371ad785ec503aed61eab41ba61f1a9807aab25451a24efda3db64855c9ba0025645b98bc58557bc3ec56c5b3297d0
Diffstat (limited to 'src/wallet/db.cpp')
-rw-r--r-- | src/wallet/db.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 4ed28b0623..d90e8e6433 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -14,8 +14,6 @@ #include <sys/stat.h> #endif -#include <boost/thread.hpp> - namespace { //! Make sure database has a unique fileid within the environment. If it @@ -671,7 +669,6 @@ bool BerkeleyBatch::PeriodicFlush(BerkeleyDatabase& database) if (nRefCount == 0) { - boost::this_thread::interruption_point(); std::map<std::string, int>::iterator mi = env->mapFileUseCount.find(strFile); if (mi != env->mapFileUseCount.end()) { |