diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-04-23 11:36:54 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-06-10 19:49:54 +0200 |
commit | 53e71135de2933ef1204bb02487d4c45a95d2e28 (patch) | |
tree | acfd11fae2bb093a83e6d8b6622a90086870d3b5 /src/net.cpp | |
parent | a2a2874fc03102c2e847cd165db1ff1f5d84fa89 (diff) |
changes to thread code (directly use boost::thread)
- removes our NewThread() function an replaces remaining calls with
boost::thread with our TraceThread template
- remove ExitThread() function
- fix THREAD_PRIORITY_ABOVE_NORMAL for non Windows OSes
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/net.cpp b/src/net.cpp index adc5f93029..1f8b39ac98 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -389,11 +389,8 @@ bool GetMyExternalIP(CNetAddr& ipRet) return false; } -void ThreadGetMyExternalIP(void* parg) +void ThreadGetMyExternalIP() { - // Make this thread recognisable as the external IP detection thread - RenameThread("bitcoin-ext-ip"); - CNetAddr addrLocalHost; if (GetMyExternalIP(addrLocalHost)) { @@ -1151,7 +1148,7 @@ void MapPort(bool fUseUPnP) upnp_thread->join(); delete upnp_thread; } - upnp_thread = new boost::thread(boost::bind(&TraceThread<boost::function<void()> >, "upnp", &ThreadMapPort)); + upnp_thread = new boost::thread(boost::bind(&TraceThread<void (*)()>, "upnp", &ThreadMapPort)); } else if (upnp_thread) { upnp_thread->interrupt(); @@ -1800,7 +1797,7 @@ void static Discover() // Don't use external IPv4 discovery, when -onlynet="IPv6" if (!IsLimited(NET_IPV4)) - NewThread(ThreadGetMyExternalIP, NULL); + boost::thread(boost::bind(&TraceThread<void (*)()>, "ext-ip", &ThreadGetMyExternalIP)); } void StartNode(boost::thread_group& threadGroup) @@ -1823,7 +1820,7 @@ void StartNode(boost::thread_group& threadGroup) if (!GetBoolArg("-dnsseed", true)) printf("DNS seeding disabled\n"); else - threadGroup.create_thread(boost::bind(&TraceThread<boost::function<void()> >, "dnsseed", &ThreadDNSAddressSeed)); + threadGroup.create_thread(boost::bind(&TraceThread<void (*)()>, "dnsseed", &ThreadDNSAddressSeed)); #ifdef USE_UPNP // Map ports with UPnP |