| 862 | } |
| 863 | |
| 864 | void MapPort(bool fUseUPnP) { |
| 865 | static boost::thread* upnp_thread = nullptr; |
| 866 | |
| 867 | if (fUseUPnP) { |
| 868 | if (upnp_thread) { |
| 869 | upnp_thread->interrupt(); |
| 870 | upnp_thread->join(); |
| 871 | delete upnp_thread; |
| 872 | } |
| 873 | upnp_thread = new boost::thread(boost::bind(&TraceThread<void (*)()>, "upnp", &ThreadMapPort)); |
| 874 | } else if (upnp_thread) { |
| 875 | upnp_thread->interrupt(); |
| 876 | upnp_thread->join(); |
| 877 | delete upnp_thread; |
| 878 | upnp_thread = nullptr; |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | #else |
| 883 | void MapPort(bool) { |