hidapi_thread_create() now returns int — heads-up for out-of-tree HIDAPI_THREAD_MODEL_INCLUDE thread models #829
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#829
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The libusb backend hotplug work (#825) changed
hidapi_thread_create()inlibusb/hidapi_thread_pthread.hfrom returningvoidto returningint, so apthread_createfailure can be detected and unwound (a failed read-thread creation now reattaches the kernel driver and fails the open, rather than hanging forever inhidapi_thread_barrier_wait()).Downstream projects that supply their own thread model via
HIDAPI_THREAD_MODEL_INCLUDE(e.g. SDL) and still declarestatic void hidapi_thread_create(...)will fail to compile against the new call sites (if (hidapi_thread_create(...) != 0)). The migration is one line: change the return type tointand return the underlying create result (0on success, non-zero on failure).Filing so embedders get a heads-up before this reaches a release.
Drafted with Claude Code.