From f26866b9caf9ff27d129c703f51b8c2922000243 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 7 Feb 2018 17:20:16 -0500 Subject: boost: drop boost threads for upnp --- src/init.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 50643ff96..2912beec6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -165,6 +165,7 @@ void Interrupt() InterruptRPC(); InterruptREST(); InterruptTorControl(); + InterruptMapPort(); if (g_connman) g_connman->Interrupt(); } @@ -191,7 +192,7 @@ void Shutdown() #ifdef ENABLE_WALLET FlushWallets(); #endif - MapPort(false); + StopMapPort(); // Because these depend on each-other, we make sure that neither can be // using the other before destroying them. @@ -1669,7 +1670,9 @@ bool AppInitMain() Discover(threadGroup); // Map ports with UPnP - MapPort(gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)); + if (gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)) { + StartMapPort(); + } CConnman::Options connOptions; connOptions.nLocalServices = nLocalServices; -- cgit v1.2.3 From ba917249486310985a34a5250bb570ca18821322 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 7 Feb 2018 17:42:39 -0500 Subject: boost: remove useless threadGroup parameter from Discover --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 2912beec6..9524da93c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1667,7 +1667,7 @@ bool AppInitMain() if (gArgs.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) StartTorControl(threadGroup, scheduler); - Discover(threadGroup); + Discover(); // Map ports with UPnP if (gArgs.GetBoolArg("-upnp", DEFAULT_UPNP)) { -- cgit v1.2.3 From 08272671d2218eb69589a0639cbb61ef7cde3004 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 7 Feb 2018 18:33:20 -0500 Subject: boost: drop boost threads from torcontrol --- src/init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 9524da93c..9f61989a2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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(); -- cgit v1.2.3 From 004f9999464c7ef4a57b281dcbb407e5d193e798 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 7 Feb 2018 19:19:34 -0500 Subject: boost: drop boost threads for [alert|block|wallet]notify --- src/init.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index 9f61989a2..ec2edd9ca 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -546,7 +546,8 @@ static void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex std::string strCmd = gArgs.GetArg("-blocknotify", ""); if (!strCmd.empty()) { boost::replace_all(strCmd, "%s", pBlockIndex->GetBlockHash().GetHex()); - boost::thread t(runCommand, strCmd); // thread runs free + std::thread t(runCommand, strCmd); + t.detach(); // thread runs free } } -- cgit v1.2.3