Merge #17382: rpc: Remove unused boost::this_thread::interruption_point

fa5facd3e7 rpc: Remove unused boost::this_thread::interruption_point (MarcoFalke)

Pull request description:

  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, the rpc threads are `std::thread`, which does not have an `std:🧵:interrupt` member function to request interruption: https://dev.visucore.com/bitcoin/doxygen/httpserver_8cpp.html#ae1a63374e18b9abd348eb74e4243ea34

  Thus, the interruption points can be removed.

ACKs for top commit:
  laanwj:
    ACK fa5facd3e7, this does nothing.
  practicalswift:
    ACK fa5facd3e7
  jamesob:
    ACK fa5facd3e7

Tree-SHA512: 4e29a44df1f2702cbd1ffdffa559440a8bb800baab64b4116e2c3d27cd64d8d1e8aafe1dc21b1a4e3988470d03be19cae294bd5669f7abf6d487685dc8fd8d7e
pull/764/head
Wladimir J. van der Laan 5 years ago
commit 45e65376ac
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

@ -14,9 +14,6 @@
#include <map> #include <map>
#include <boost/thread.hpp>
static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, const std::map<uint32_t, Coin>& outputs) static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, const std::map<uint32_t, Coin>& outputs)
{ {
assert(!outputs.empty()); assert(!outputs.empty());
@ -52,7 +49,6 @@ bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)
uint256 prevkey; uint256 prevkey;
std::map<uint32_t, Coin> outputs; std::map<uint32_t, Coin> outputs;
while (pcursor->Valid()) { while (pcursor->Valid()) {
boost::this_thread::interruption_point();
COutPoint key; COutPoint key;
Coin coin; Coin coin;
if (pcursor->GetKey(key) && pcursor->GetValue(coin)) { if (pcursor->GetKey(key) && pcursor->GetValue(coin)) {

@ -39,8 +39,6 @@
#include <univalue.h> #include <univalue.h>
#include <boost/thread/thread.hpp> // boost::thread::interrupt
#include <condition_variable> #include <condition_variable>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
@ -1976,7 +1974,6 @@ bool FindScriptPubKey(std::atomic<int>& scan_progress, const std::atomic<bool>&
Coin coin; Coin coin;
if (!cursor->GetKey(key) || !cursor->GetValue(coin)) return false; if (!cursor->GetKey(key) || !cursor->GetValue(coin)) return false;
if (++count % 8192 == 0) { if (++count % 8192 == 0) {
boost::this_thread::interruption_point();
if (should_abort) { if (should_abort) {
// allow to abort the scan via the abort reference // allow to abort the scan via the abort reference
return false; return false;

Loading…
Cancel
Save