From bdce679d84657feeac45c1703c2d828586bb649b Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 13 May 2015 16:55:18 -0700 Subject: Should fix deadlock issue in GitHub issue #166 --- node/Network.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 79ae3a90..f99ea525 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -55,6 +55,7 @@ namespace ZeroTier { class RuntimeEnvironment; +class _AnnounceMulticastGroupsToPeersWithActiveDirectPaths; /** * A virtual LAN @@ -62,6 +63,7 @@ class RuntimeEnvironment; class Network : NonCopyable { friend class SharedPtr; + friend class _AnnounceMulticastGroupsToPeersWithActiveDirectPaths; public: /** @@ -197,7 +199,11 @@ public: * @param peer Peer address to check * @return True if peer is allowed to communicate on this network */ - bool isAllowed(const Address &peer) const; + inline bool isAllowed(const Address &peer) const + { + Mutex::Lock _l(_lock); + return _isAllowed(peer); + } /** * Perform cleanup and possibly save state @@ -348,6 +354,7 @@ public: private: ZT1_VirtualNetworkStatus _status() const; void _externalConfig(ZT1_VirtualNetworkConfig *ec) const; // assumes _lock is locked + bool _isAllowed(const Address &peer) const; void _announceMulticastGroups(); const RuntimeEnvironment *RR; -- cgit v1.2.3