]> git.ipfire.org Git - thirdparty/wireguard-go.git/commit
device: move Queue{In,Out}boundElement Mutex to container type
authorJordan Whited <jordan@tailscale.com>
Mon, 2 Oct 2023 21:48:28 +0000 (14:48 -0700)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 10 Oct 2023 13:07:36 +0000 (15:07 +0200)
commit1ec454f253c068f74ba7a7aea34546c9819493c0
treeb7f3af5cb9487c892cc4d2390c10f0ca7f5e86b7
parent8a015f7c766564c21f6bef6fdddedce7e2ede830
device: move Queue{In,Out}boundElement Mutex to container type

Queue{In,Out}boundElement locking can contribute to significant
overhead via sync.Mutex.lockSlow() in some environments. These types
are passed throughout the device package as elements in a slice, so
move the per-element Mutex to a container around the slice.

Reviewed-by: Maisem Ali <maisem@tailscale.com>
Signed-off-by: Jordan Whited <jordan@tailscale.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
device/channels.go
device/device.go
device/peer.go
device/pools.go
device/receive.go
device/send.go