]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Reorder stopping messages so that logs are coherent
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 5 May 2018 04:09:30 +0000 (06:09 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 5 May 2018 04:09:30 +0000 (06:09 +0200)
receive.go
send.go

index e323c6d0c6d972f976bdbfc4eadafe37be304e2f..d4245afe5c834482d6d36fb6a924495dee9bd99e 100644 (file)
@@ -238,8 +238,8 @@ func (device *Device) RoutineDecryption() {
 
        logDebug := device.log.Debug
        defer func() {
-               device.state.stopping.Done()
                logDebug.Println("Routine: decryption worker - stopped")
+               device.state.stopping.Done()
        }()
        logDebug.Println("Routine: decryption worker - started")
 
@@ -304,8 +304,8 @@ func (device *Device) RoutineHandshake() {
        logDebug := device.log.Debug
 
        defer func() {
-               device.state.stopping.Done()
                logDebug.Println("Routine: handshake worker - stopped")
+               device.state.stopping.Done()
        }()
 
        logDebug.Println("Routine: handshake worker - started")
@@ -534,8 +534,8 @@ func (peer *Peer) RoutineSequentialReceiver() {
        logDebug := device.log.Debug
 
        defer func() {
-               peer.routines.stopping.Done()
                logDebug.Println(peer, ": Routine: sequential receiver - stopped")
+               peer.routines.stopping.Done()
        }()
 
        logDebug.Println(peer, ": Routine: sequential receiver - started")
diff --git a/send.go b/send.go
index e41be838bc5362b0c9b094cb88c9a92785f9d6da..4ed084d876184a231513e42490aa24de4cb87293 100644 (file)
--- a/send.go
+++ b/send.go
@@ -200,8 +200,8 @@ func (peer *Peer) RoutineNonce() {
        logDebug := device.log.Debug
 
        defer func() {
-               peer.routines.stopping.Done()
                logDebug.Println(peer, ": Routine: nonce worker - stopped")
+               peer.routines.stopping.Done()
        }()
 
        peer.routines.starting.Done()
@@ -274,8 +274,8 @@ func (device *Device) RoutineEncryption() {
        logDebug := device.log.Debug
 
        defer func() {
-               device.state.stopping.Done()
                logDebug.Println("Routine: encryption worker - stopped")
+               device.state.stopping.Done()
        }()
 
        logDebug.Println("Routine: encryption worker - started")
@@ -348,8 +348,8 @@ func (peer *Peer) RoutineSequentialSender() {
        logDebug := device.log.Debug
 
        defer func() {
-               peer.routines.stopping.Done()
                logDebug.Println(peer, ": Routine: sequential sender - stopped")
+               peer.routines.stopping.Done()
        }()
 
        logDebug.Println(peer, ": Routine: sequential sender - started")