aboutsummaryrefslogtreecommitdiffstats
path: root/device/send.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josh@tailscale.com>2020-12-10 11:25:08 -0800
committerJason A. Donenfeld <Jason@zx2c4.com>2021-01-07 14:49:44 +0100
commitc9e4a859ae8cdd7046a467afe8b50c5364c2cfc7 (patch)
tree933a4c47443a72e8431ec5155775f93a84ac2314 /device/send.go
parentdevice: make test setup more robust (diff)
downloadwireguard-go-c9e4a859ae8cdd7046a467afe8b50c5364c2cfc7.tar.xz
wireguard-go-c9e4a859ae8cdd7046a467afe8b50c5364c2cfc7.zip
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>
Diffstat (limited to 'device/send.go')
-rw-r--r--device/send.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/device/send.go b/device/send.go
index cb3e3f6..0801b71 100644
--- a/device/send.go
+++ b/device/send.go
@@ -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 {