mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Remove router.doAdmin and switchTable.doAdmin
This commit is contained in:
parent
a8b323acdd
commit
5d7d84f827
8 changed files with 15 additions and 25 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue