Page MenuHomePhabricator

Remove unused boost/thread
ClosedPublic

Authored by PiRK on May 13 2021, 14:08.

Details

Reviewers
majcosta
deadalnix
Group Reviewers
Restricted Project
Commits
rABC6197d93261f8: Remove unused boost/thread
Summary

txindex: Remove unused boost/thread

txdb: Remove unused boost/thread

refactor: Specify boost/thread/thread.hpp explicitly

There are predefined interruption points for boost::thread: https://www.boost.org/doc/libs/1_71_0/doc/html/thread/thread_management.html#interruption_points

However, non-boost threads such as std::thread or the main() thread can obviously not be interrupted. So remove all unused boost/thread from methods that are never executed in a boost::thread.

Most of them were accompanied by a ShutdownRequested anyway. So even if the current thread was a boost::thread, the interruption point would be redundant. (We only interrupt threads during shutdown)

To make it work for our codebase, I had to add an addition include in system.cpp and core_io_tests.cpp.

This is a backport of core#18758

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.May 13 2021, 14:08
majcosta requested changes to this revision.May 13 2021, 15:56
majcosta added a subscriber: majcosta.
majcosta added inline comments.
src/util/system.cpp
16

you sure you need this?

This revision now requires changes to proceed.May 13 2021, 15:56

#include <boost/thread/thread.hpp> is not needed in src/util/system.cpp

This revision is now accepted and ready to land.May 13 2021, 17:54
This revision was automatically updated to reflect the committed changes.