mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
Merge #18792: wallet: Remove boost from PeriodicFlush
fa1c74fd03
wallet: Remove unused boost::thread_interrupted (MarcoFalke)fa7b885f51
walletdb: Remove unsed boost/thread (MarcoFalke)5555d978b0
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 flushed9ccaee1d5e/src/init.cpp (L194)
and another flush should be a noop. Also, they will be flushed again shortly after9ccaee1d5e/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: ACKfa1c74fd03
Tree-SHA512: b166619256de2ef4325480fa1367f68bc9371ad785ec503aed61eab41ba61f1a9807aab25451a24efda3db64855c9ba0025645b98bc58557bc3ec56c5b3297d0
This commit is contained in:
commit
5879bfa9a5
2 changed files with 2 additions and 15 deletions
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include <atomic>
|
||||
#include <string>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
namespace DBKeys {
|
||||
const std::string ACENTRY{"acentry"};
|
||||
const std::string ACTIVEEXTERNALSPK{"activeexternalspk"};
|
||||
|
@ -745,11 +743,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
|
|||
pwallet->WalletLogPrintf("%s\n", strErr);
|
||||
}
|
||||
pcursor->close();
|
||||
}
|
||||
catch (const boost::thread_interrupted&) {
|
||||
throw;
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
result = DBErrors::CORRUPT;
|
||||
}
|
||||
|
||||
|
@ -887,11 +881,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
|
|||
}
|
||||
}
|
||||
pcursor->close();
|
||||
}
|
||||
catch (const boost::thread_interrupted&) {
|
||||
throw;
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
result = DBErrors::CORRUPT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue