4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-07-07 01:04:07 +00:00

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
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)
}