Make EthernetTap creation occur in a background thread in Network since it's a time consuming operation on Windows. This fixes one of the last remaining Windows problems.

This commit is contained in:
Adam Ierymenko 2014-01-27 23:13:36 -08:00
parent e0cb5caef2
commit f80ec871f6
12 changed files with 239 additions and 105 deletions

View file

@ -90,11 +90,6 @@ public:
return nwlist;
}
/**
* Call whack() on all networks' tap devices
*/
void whackAllTaps();
/**
* Perform cleanup and possibly update saved state
*/
@ -117,8 +112,11 @@ public:
{
std::set<std::string> tapDevs;
Mutex::Lock _l(_networks_m);
for(std::map< uint64_t,SharedPtr<Network> >::const_iterator n(_networks.begin());n!=_networks.end();++n)
tapDevs.insert(n->second->tap().deviceName());
for(std::map< uint64_t,SharedPtr<Network> >::const_iterator n(_networks.begin());n!=_networks.end();++n) {
std::string dn(n->second->tapDeviceName());
if (dn.length())
tapDevs.insert(dn);
}
return tapDevs;
}