| 1182 | } |
| 1183 | |
| 1184 | void MapPort(bool fUseUPnP) |
| 1185 | { |
| 1186 | static boost::thread* upnp_thread = NULL; |
| 1187 | |
| 1188 | if (fUseUPnP) |
| 1189 | { |
| 1190 | if (upnp_thread) { |
| 1191 | upnp_thread->interrupt(); |
| 1192 | upnp_thread->join(); |
| 1193 | delete upnp_thread; |
| 1194 | } |
| 1195 | upnp_thread = new boost::thread(boost::bind(&TraceThread<void (*)()>, "upnp", &ThreadMapPort)); |
| 1196 | } |
| 1197 | else if (upnp_thread) { |
| 1198 | upnp_thread->interrupt(); |
| 1199 | upnp_thread->join(); |
| 1200 | delete upnp_thread; |
| 1201 | upnp_thread = NULL; |
| 1202 | } |
| 1203 | } |
| 1204 | |
| 1205 | #else |
| 1206 | void MapPort(bool) |