summaryrefslogtreecommitdiff
path: root/testnet
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-28 17:29:45 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-28 17:29:45 -0700
commitf65b48d447e414e3cdc1e6787cf92a795a11956b (patch)
tree79e19fac03f792954d20613d5e2b01170ff5ef3b /testnet
parent5bb854e504a0db968b47c0a983d0148629e126e7 (diff)
downloadinfinitytier-f65b48d447e414e3cdc1e6787cf92a795a11956b.tar.gz
infinitytier-f65b48d447e414e3cdc1e6787cf92a795a11956b.zip
Thread sync bug...
Diffstat (limited to 'testnet')
-rw-r--r--testnet/TestEthernetTapFactory.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/testnet/TestEthernetTapFactory.cpp b/testnet/TestEthernetTapFactory.cpp
index 1e72bc4e..105341ec 100644
--- a/testnet/TestEthernetTapFactory.cpp
+++ b/testnet/TestEthernetTapFactory.cpp
@@ -69,18 +69,12 @@ void TestEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevice
if (!tap)
return;
SharedPtr<TestEthernetTap> tapp((TestEthernetTap *)tap);
- {
- Mutex::Lock _l(_taps_m);
- _taps.erase(tapp);
- }
- {
- Mutex::Lock _l(_tapsByMac_m);
- _tapsByMac.erase(tapp->mac());
- }
- {
- Mutex::Lock _l(_tapsByNwid_m);
- _tapsByNwid.erase(tapp->nwid());
- }
+ Mutex::Lock _l1(_taps_m);
+ Mutex::Lock _l2(_tapsByMac_m);
+ Mutex::Lock _l3(_tapsByNwid_m);
+ _taps.erase(tapp);
+ _tapsByMac.erase(tapp->mac());
+ _tapsByNwid.erase(tapp->nwid());
}
} // namespace ZeroTier