summaryrefslogtreecommitdiffhomepage
path: root/send.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 22:20:15 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-16 22:20:15 +0200
commit846d721dfd0cde953f2e9304d6ef50110de050eb (patch)
tree8de15914ab39d0aad1b50d03530b82fece54c740 /send.go
parent23eca94508d7cef0c1adbbc37c81050899ca1d60 (diff)
Finer-grained start-stop synchronization
Diffstat (limited to 'send.go')
-rw-r--r--send.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/send.go b/send.go
index 9a59abd..5605ad1 100644
--- a/send.go
+++ b/send.go
@@ -247,9 +247,11 @@ func (device *Device) RoutineReadFromTUN() {
defer func() {
logDebug.Println("Routine: TUN reader - stopped")
+ device.state.stopping.Done()
}()
logDebug.Println("Routine: TUN reader - started")
+ device.state.starting.Done()
for {
@@ -424,6 +426,7 @@ func (device *Device) RoutineEncryption() {
}()
logDebug.Println("Routine: encryption worker - started")
+ device.state.starting.Done()
for {