summaryrefslogtreecommitdiff
path: root/server/NetworkController.cpp
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2018-01-10 22:12:29 +0900
committerLorenzo Colitti <lorenzo@google.com>2018-01-10 22:15:01 +0900
commit2d014e746ab408feba60d6912af6ca1e88cc60da (patch)
tree3463317353dafd081717aeee86e77060817036f7 /server/NetworkController.cpp
parentbbd0aff37314af767b53481b26210461178a0013 (diff)
Expand the comment about locking in NetworkController::mDelegate
Test: builds Change-Id: Iaa32c1deb71da546e23ab48459df1388cd1d6d38
Diffstat (limited to 'server/NetworkController.cpp')
-rw-r--r--server/NetworkController.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/NetworkController.cpp b/server/NetworkController.cpp
index f36ed772..43a55bdd 100644
--- a/server/NetworkController.cpp
+++ b/server/NetworkController.cpp
@@ -60,6 +60,13 @@ const unsigned NetworkController::DUMMY_NET_ID = 51;
const unsigned NetworkController::LOCAL_NET_ID = 99;
// All calls to methods here are made while holding a write lock on mRWLock.
+// They are mostly not called directly from this class, but from methods in PhysicalNetwork.cpp.
+// However, we're the only user of that class, so all calls to those methods come from here and are
+// made under lock.
+// For example, PhysicalNetwork::setPermission ends up calling addFallthrough and removeFallthrough,
+// but it's only called from here under lock (specifically, from createPhysicalNetworkLocked and
+// setPermissionForNetworks).
+// TODO: use std::mutex and GUARDED_BY instead of manual inspection.
class NetworkController::DelegateImpl : public PhysicalNetwork::Delegate {
public:
explicit DelegateImpl(NetworkController* networkController);