Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@osy
Copy link
Contributor

@osy osy commented Aug 25, 2025

If two threads try to capture at the same time, the result can be inconsistent. For example, a process can have two different contexts to libusb and both call libusb_reset_device.

@Mr-Bossman
Copy link
Contributor

I wonder if this fixes #1635 I'll check in a bit

@mcuee mcuee added the macOS label Aug 25, 2025
@seanm
Copy link
Contributor

seanm commented Aug 26, 2025

@osy BTW you may be interested in #1419

In fact I think I'll revive that effort, we could probably get some of it in first...

libusb/os/darwin_usb.h Show resolved Hide resolved
libusb/os/darwin_usb.h Outdated Show resolved Hide resolved
@mcuee
Copy link
Member

mcuee commented Sep 19, 2025

@osy

Would you please address the comments from @seanm? Thanks.

If two threads try to capture at the same time, the result can be
inconsistent. For example, a process can have two different contexts to
libusb and both call `libusb_reset_device`.
We need to maintain the invariant that `device` is never an invalid
pointer because another thread might be concurrently accessing it. We
want that thread to error from an outdated `device` rather than crash
on a NULL pointer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.