device: refactor container locking for lock-order clarity

Device-side portion of upstream tailscale/wireguard-go e3ac4a0
(device, cmd/check-lockorder: add static analysis tool for lock
ordering); the analyzer itself is not carried in this fork.
This commit is contained in:
Brad Fitzpatrick 2026-04-26 15:02:22 +00:00 committed by 世界
parent 7c3a736cbe
commit 2ad9837e6c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
6 changed files with 214 additions and 182 deletions

View file

@ -74,7 +74,6 @@ func (device *Device) PopulatePools() {
func (device *Device) GetInboundElementsContainer() *QueueInboundElementsContainer {
c := device.pool.inboundElementsContainer.Get().(*QueueInboundElementsContainer)
c.Mutex = sync.Mutex{}
return c
}
@ -88,7 +87,6 @@ func (device *Device) PutInboundElementsContainer(c *QueueInboundElementsContain
func (device *Device) GetOutboundElementsContainer() *QueueOutboundElementsContainer {
c := device.pool.outboundElementsContainer.Get().(*QueueOutboundElementsContainer)
c.Mutex = sync.Mutex{}
return c
}