Skip to content

Commit

Permalink
Merge bitcoin#26292: util: move threadinterrupt into util/
Browse files Browse the repository at this point in the history
b895304 util: move threadinterrupt into util (fanquake)

Pull request description:

  Alongside thread and threadnames. It's part of libbitcoin_util.

ACKs for top commit:
  ryanofsky:
    Code review ACK b895304. No changes since last review other than rebase
  theuni:
    ACK b895304.

Tree-SHA512: 0421f4d1881ec295272446804b27d16bf63e6b62b272f8bb52bfecde9ae6605e8109ed16294690d3e3ce4b15cc5e7c4046f99442df73adb10bdf069d3fb165aa
  • Loading branch information
fanquake committed Nov 22, 2022
2 parents 542a2b5 + b895304 commit 1b68094
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ci/test/06_script_b.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ if [ "${RUN_TIDY}" = "true" ]; then
" src/rpc/fees.cpp"\
" src/rpc/signmessage.cpp"\
" src/test/fuzz/txorphan.cpp"\
" src/threadinterrupt.cpp"\
" src/util/bip32.cpp"\
" src/util/bytevectorhash.cpp"\
" src/util/check.cpp"\
Expand All @@ -70,6 +69,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
" src/util/strencodings.cpp"\
" src/util/string.cpp"\
" src/util/syserror.cpp"\
" src/util/threadinterrupt.cpp"\
" src/zmq"\
" -p . ${MAKEJOBS} -- -Xiwyu --cxx17ns -Xiwyu --mapping_file=${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp"
fi
Expand Down
4 changes: 2 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ BITCOIN_CORE_H = \
support/events.h \
support/lockedpool.h \
sync.h \
threadinterrupt.h \
threadsafety.h \
timedata.h \
torcontrol.h \
Expand Down Expand Up @@ -298,6 +297,7 @@ BITCOIN_CORE_H = \
util/syserror.h \
util/system.h \
util/thread.h \
util/threadinterrupt.h \
util/threadnames.h \
util/time.h \
util/tokenpipe.h \
Expand Down Expand Up @@ -687,7 +687,6 @@ libbitcoin_util_a_SOURCES = \
rpc/request.cpp \
support/cleanse.cpp \
sync.cpp \
threadinterrupt.cpp \
util/asmap.cpp \
util/bip32.cpp \
util/bytevectorhash.cpp \
Expand All @@ -705,6 +704,7 @@ libbitcoin_util_a_SOURCES = \
util/readwritefile.cpp \
util/settings.cpp \
util/thread.cpp \
util/threadinterrupt.cpp \
util/threadnames.cpp \
util/serfloat.cpp \
util/spanparsing.cpp \
Expand Down
1 change: 1 addition & 0 deletions src/i2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <util/spanparsing.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/threadinterrupt.h>

#include <chrono>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/i2p.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <fs.h>
#include <netaddress.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <util/sock.h>
#include <util/threadinterrupt.h>

#include <memory>
#include <optional>
Expand Down
2 changes: 1 addition & 1 deletion src/index/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <dbwrapper.h>
#include <interfaces/chain.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <validationinterface.h>

#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
#include <net.h>
#include <netaddress.h>
#include <netbase.h>
#include <threadinterrupt.h>
#include <util/syscall_sandbox.h>
#include <util/system.h>
#include <util/thread.h>
#include <util/threadinterrupt.h>

#ifdef USE_NATPMP
#include <compat/compat.h>
Expand Down
1 change: 1 addition & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <util/syscall_sandbox.h>
#include <util/system.h>
#include <util/thread.h>
#include <util/threadinterrupt.h>
#include <util/trace.h>
#include <util/translation.h>

Expand Down
2 changes: 1 addition & 1 deletion src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#include <span.h>
#include <streams.h>
#include <sync.h>
#include <threadinterrupt.h>
#include <uint256.h>
#include <util/check.h>
#include <util/sock.h>
#include <util/threadinterrupt.h>

#include <atomic>
#include <condition_variable>
Expand Down
2 changes: 1 addition & 1 deletion src/test/fuzz/i2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <test/util/setup_common.h>
#include <threadinterrupt.h>
#include <util/system.h>
#include <util/threadinterrupt.h>

void initialize_i2p()
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/i2p_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <test/util/logging.h>
#include <test/util/net.h>
#include <test/util/setup_common.h>
#include <threadinterrupt.h>
#include <util/system.h>
#include <util/threadinterrupt.h>

#include <boost/test/unit_test.hpp>

Expand Down
2 changes: 1 addition & 1 deletion src/test/sock_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include <compat/compat.h>
#include <test/util/setup_common.h>
#include <threadinterrupt.h>
#include <util/sock.h>
#include <util/system.h>
#include <util/threadinterrupt.h>

#include <boost/test/unit_test.hpp>

Expand Down
2 changes: 1 addition & 1 deletion src/util/sock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

#include <compat/compat.h>
#include <logging.h>
#include <threadinterrupt.h>
#include <tinyformat.h>
#include <util/sock.h>
#include <util/syserror.h>
#include <util/system.h>
#include <util/threadinterrupt.h>
#include <util/time.h>

#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/util/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define BITCOIN_UTIL_SOCK_H

#include <compat/compat.h>
#include <threadinterrupt.h>
#include <util/threadinterrupt.h>
#include <util/time.h>

#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion src/threadinterrupt.cpp → src/util/threadinterrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <threadinterrupt.h>
#include <util/threadinterrupt.h>

#include <sync.h>

Expand Down
6 changes: 3 additions & 3 deletions src/threadinterrupt.h → src/util/threadinterrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_THREADINTERRUPT_H
#define BITCOIN_THREADINTERRUPT_H
#ifndef BITCOIN_UTIL_THREADINTERRUPT_H
#define BITCOIN_UTIL_THREADINTERRUPT_H

#include <sync.h>
#include <threadsafety.h>
Expand Down Expand Up @@ -33,4 +33,4 @@ class CThreadInterrupt
std::atomic<bool> flag;
};

#endif // BITCOIN_THREADINTERRUPT_H
#endif // BITCOIN_UTIL_THREADINTERRUPT_H

0 comments on commit 1b68094

Please sign in to comment.