Skip to content

Commit

Permalink
boost: drop boost threads from torcontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
theuni committed Feb 8, 2018
1 parent ba91724 commit 0827267
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ bool AppInitMain()
LogPrintf("nBestHeight = %d\n", chain_active_height);

if (gArgs.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION))
StartTorControl(threadGroup, scheduler);
StartTorControl();

Discover();

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

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

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

void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler)
void StartTorControl()
{
assert(!gBase);
#ifdef WIN32
Expand All @@ -754,7 +754,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 0827267

Please sign in to comment.