Remove router.doAdmin and switchTable.doAdmin

This commit is contained in:
Neil Alexander 2019-08-28 12:17:19 +01:00
parent a8b323acdd
commit 5d7d84f827
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
8 changed files with 15 additions and 25 deletions

View file

@ -278,7 +278,7 @@ func (t *switchTable) blockPeer(port switchPort) {
}
// Removes a peer.
// Must be called by the router mainLoop goroutine, e.g. call router.doAdmin with a lambda that calls this.
// Must be called by the router actor with a lambda that calls this.
// If the removed peer was this node's parent, it immediately tries to find a new parent.
func (t *switchTable) forgetPeer(port switchPort) {
t.mutex.Lock()
@ -866,9 +866,3 @@ func (t *switchTable) _idleIn(port switchPort) {
t.idle[port] = time.Now()
}
}
// Passed a function to call.
// This will send the function to t.admin and block until it finishes.
func (t *switchTable) doAdmin(f func()) {
phony.Block(t, f)
}