| 1274 | } |
| 1275 | |
| 1276 | void MapPort(bool fUseUPnP) |
| 1277 | { |
| 1278 | static boost::thread* upnp_thread = NULL; |
| 1279 | |
| 1280 | if (fUseUPnP) { |
| 1281 | if (upnp_thread) { |
| 1282 | upnp_thread->interrupt(); |
| 1283 | upnp_thread->join(); |
| 1284 | delete upnp_thread; |
| 1285 | } |
| 1286 | upnp_thread = new boost::thread(boost::bind(&TraceThread<void (*)()>, "upnp", &ThreadMapPort)); |
| 1287 | } else if (upnp_thread) { |
| 1288 | upnp_thread->interrupt(); |
| 1289 | upnp_thread->join(); |
| 1290 | delete upnp_thread; |
| 1291 | upnp_thread = NULL; |
| 1292 | } |
| 1293 | } |
| 1294 | |
| 1295 | #else |
| 1296 | void MapPort(bool) |