aboutsummaryrefslogtreecommitdiffstats
path: root/send.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-05 06:00:38 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-05 06:00:38 +0200
commita46401bbb151d8f1e662dc16b612426352138c1e (patch)
tree4fa4b0ac6777c8fca2c300bbae1323056bb5e47e /send.go
parentFix infinite loop in exit routine (diff)
downloadwireguard-go-a46401bbb151d8f1e662dc16b612426352138c1e.tar.xz
wireguard-go-a46401bbb151d8f1e662dc16b612426352138c1e.zip
More robust solution to close deadlock
Diffstat (limited to '')
-rw-r--r--send.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/send.go b/send.go
index 7abe211..e41be83 100644
--- a/send.go
+++ b/send.go
@@ -274,17 +274,7 @@ func (device *Device) RoutineEncryption() {
logDebug := device.log.Debug
defer func() {
- for {
- select {
- case elem, ok := <-device.queue.encryption:
- if ok {
- elem.Drop()
- }
- default:
- goto out
- }
- }
- out:
+ device.state.stopping.Done()
logDebug.Println("Routine: encryption worker - stopped")
}()