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 (...)
)