Skip to content

hidapi_thread_create() now returns int — heads-up for out-of-tree HIDAPI_THREAD_MODEL_INCLUDE thread models #829

Description

@Youw

The libusb backend hotplug work (#825) changed hidapi_thread_create() in libusb/hidapi_thread_pthread.h from returning void to returning int, so a pthread_create failure can be detected and unwound (a failed read-thread creation now reattaches the kernel driver and fails the open, rather than hanging forever in hidapi_thread_barrier_wait()).

Downstream projects that supply their own thread model via HIDAPI_THREAD_MODEL_INCLUDE (e.g. SDL) and still declare static 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 to int and return the underlying create result (0 on success, non-zero on failure).

Filing so embedders get a heads-up before this reaches a release.

Drafted with Claude Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions