device: remove starting waitgroups
In each case, the starting waitgroup did nothing but ensure that the goroutine has launched. Nothing downstream depends on the order in which goroutines launch, and if the Go runtime scheduler is so broken that goroutines don't get launched reasonably promptly, we have much deeper problems. Given all that, simplify the code. Passed a race-enabled stress test 25,000 times without failure. Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
parent
3591acba76
commit
c9e4a859ae
5 changed files with 1 additions and 29 deletions
|
|
@ -262,7 +262,6 @@ func (device *Device) RoutineReadFromTUN() {
|
|||
}()
|
||||
|
||||
logDebug.Println("Routine: TUN reader - started")
|
||||
device.state.starting.Done()
|
||||
|
||||
var elem *QueueOutboundElement
|
||||
|
||||
|
|
@ -372,7 +371,6 @@ func (peer *Peer) RoutineNonce() {
|
|||
peer.routines.stopping.Done()
|
||||
}()
|
||||
|
||||
peer.routines.starting.Done()
|
||||
logDebug.Println(peer, "- Routine: nonce worker - started")
|
||||
|
||||
NextPacket:
|
||||
|
|
@ -507,7 +505,6 @@ func (device *Device) RoutineEncryption() {
|
|||
}()
|
||||
|
||||
logDebug.Println("Routine: encryption worker - started")
|
||||
device.state.starting.Done()
|
||||
|
||||
for {
|
||||
|
||||
|
|
@ -596,8 +593,6 @@ func (peer *Peer) RoutineSequentialSender() {
|
|||
|
||||
logDebug.Println(peer, "- Routine: sequential sender - started")
|
||||
|
||||
peer.routines.starting.Done()
|
||||
|
||||
for {
|
||||
select {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue