Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HotplugWatch is not Send on Windows #104

Closed
guineawheek opened this issue Jan 3, 2025 · 1 comment · Fixed by #105
Closed

HotplugWatch is not Send on Windows #104

guineawheek opened this issue Jan 3, 2025 · 1 comment · Fixed by #105

Comments

@guineawheek
Copy link

guineawheek commented Jan 3, 2025

On Linux and macOS, nusb::hotplug::HotplugWatch is Send which makes it easy to use things like tokio::spawn for a hotplug task.

On Windows, because pointers are not Send and the backend implementation uses a Box split into a raw pointer, this doesn't hold.

Would it make sense to manually implement Send on WindowsHotplugWatch given that it seems fine to send between threads (especially given Box implements Send)?

@kevinmehall
Copy link
Owner

Yes, that's an oversight. Fixed in #105. Also added Sync since it's trivially satisfied since the only method takes &mut self.

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 a pull request may close this issue.

2 participants