From 5e3c633f74e029a948137d7e85a4913c8ae7ff62 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 28 Aug 2019 11:59:13 -0700 Subject: [PATCH] root work --- root/root.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/root/root.cpp b/root/root.cpp index d1c186a13..aa3ba4506 100644 --- a/root/root.cpp +++ b/root/root.cpp @@ -60,6 +60,7 @@ #include #include #include +#include using namespace ZeroTier; @@ -72,6 +73,7 @@ struct PeerInfo struct AddressHasher { ZT_ALWAYS_INLINE std::size_t operator()(const Address &a) const { return (std::size_t)a.toInt(); } }; struct InetAddressHasher { ZT_ALWAYS_INLINE std::size_t operator()(const InetAddress &ip) const { return (std::size_t)ip.hashCode(); } }; +static std::atomic_bool run; static std::unordered_map< Address,std::map< Identity,PeerInfo >,AddressHasher > peersByVirtAddr; static std::unordered_map< InetAddress,std::map< Identity,PeerInfo >,InetAddressHasher > peersByPhysAddr; static Mutex peersByVirtAddr_l; @@ -133,6 +135,8 @@ int main(int argc,char **argv) unsigned int ncores = std::thread::hardware_concurrency(); if (ncores == 0) ncores = 1; + run = true; + std::vector sockets; std::vector threads; for(unsigned int tn=0;tn