]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: fix WaitPool sync.Cond usage
authorJordan Whited <jordan@tailscale.com>
Thu, 27 Jun 2024 15:43:41 +0000 (08:43 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 4 May 2025 16:11:00 +0000 (18:11 +0200)
commit113c8f1340ed8748da68528112d746469de11ae0
treedea9c9470ccc1d34b84ab940d5979da59143a83a
parent12269c2761734b15625017d8565745096325392f
device: fix WaitPool sync.Cond usage

The sync.Locker used with a sync.Cond must be acquired when changing
the associated condition, otherwise there is a window within
sync.Cond.Wait() where a wake-up may be missed.

Fixes: 4846070 ("device: use a waiting sync.Pool instead of a channel")
Reviewed-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
device/pools.go
device/pools_test.go