Skip to content

device: extract pool into standalone package#54

Open
illotum wants to merge 1 commit intotailscalefrom
illotum/extract-waitpool
Open

device: extract pool into standalone package#54
illotum wants to merge 1 commit intotailscalefrom
illotum/extract-waitpool

Conversation

@illotum
Copy link
Copy Markdown

@illotum illotum commented Apr 10, 2026

e.g. to access it without importing device.

Copilot AI review requested due to automatic review settings April 10, 2026 03:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the WaitPool implementation from the device package into a new standalone waitpool package so it can be imported independently of device.

Changes:

  • Added a new waitpool package providing WaitPool and its New/Get/Put API.
  • Updated device to use waitpool.WaitPool and waitpool.New for its internal pools.
  • Moved existing pool tests into the waitpool package and updated references accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
waitpool/waitpool.go Introduces the standalone WaitPool implementation.
waitpool/waitpool_test.go Updates tests to target the new waitpool package and constructor name.
waitpool/race_enabled_test.go Updates test package name to waitpool under -race build tag.
waitpool/race_disabled_test.go Updates test package name to waitpool under !race build tag.
device/pools.go Switches pool initialization from the old in-package type to waitpool.New.
device/device.go Updates pool field types to *waitpool.WaitPool and imports waitpool.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread waitpool/waitpool.go
Comment thread waitpool/waitpool.go Outdated
@illotum illotum force-pushed the illotum/extract-waitpool branch 3 times, most recently from 0662310 to 3ade42b Compare April 10, 2026 04:25
Also fixes Put-before-Get underflow bug.

Signed-off-by: Alex Valiushko <alexvaliushko@tailscale.com>
Change-Id: Icde836d1bef2e95850d3ae51b3c069056a6a6964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants