Skip to content

Commit

Permalink
boost: drop boost threads from torcontrol
Browse files Browse the repository at this point in the history
Cherry-picked from: 0827267
  • Loading branch information
theuni authored and xanimo committed Mar 29, 2024
1 parent 5d2b640 commit 21f5085
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("mapBlockIndex.size() = %u\n", mapBlockIndex.size());
LogPrintf("nBestHeight = %d\n", chainActive.Height());
if (GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION))
StartTorControl(threadGroup, scheduler);
StartTorControl();

Discover();

Expand Down
8 changes: 4 additions & 4 deletions src/torcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,8 +675,8 @@ void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg)
}

/****** Thread ********/
struct event_base *base;
boost::thread torControlThread;
static struct event_base *base;
static std::thread torControlThread;

static void TorControlThread()
{
Expand All @@ -685,7 +685,7 @@ static void TorControlThread()
event_base_dispatch(base);
}

void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler)
void StartTorControl()
{
assert(!base);
#ifdef WIN32
Expand All @@ -699,7 +699,7 @@ void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler)
return;
}

torControlThread = boost::thread(boost::bind(&TraceThread<void (*)()>, "torcontrol", &TorControlThread));
torControlThread = std::thread(std::bind(&TraceThread<void (*)()>, "torcontrol", &TorControlThread));
}

void InterruptTorControl()
Expand Down
2 changes: 1 addition & 1 deletion src/torcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
extern const std::string DEFAULT_TOR_CONTROL;
static const bool DEFAULT_LISTEN_ONION = true;

void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler);
void StartTorControl();
void InterruptTorControl();
void StopTorControl();

Expand Down

0 comments on commit 21f5085

Please sign in to comment.