Ihor Dutchak
Ihor Dutchak
`EINTR` may be caused by a number of things, e.g. a debugger (gdb) attached but I believe Ctrl+C generates `EINTR` as well, so having an infinite loop like that may...
I'd still limit the number of retries to something reasonable (10?)
> other ioctl calls Make a wrapper funciton (a macro?) to avoid heavy copy-pasting
> but both these require Objective-C (or swift I guess). They do not. HIDAPI uses something very similar in plain C: https://github.com/libusb/hidapi/blob/88a0f029b7f18fc7b3c3858d652494428b3ebc2e/mac/hid.c#L41
HIDAPI uses async `DeviceIoControl` - I can check this one out (a bit later). >add an new option to libusb_set_option to choose to use async DeviceIoControl? I don't think that...
Meanwhile, @weishaodi2zss do you mind fixing the conflict?
```cpp void signal_ready() { mtx_lock(&mtx); ready = 1; cnd_broadcast(&cv); mtx_unlock(&mtx); } ``` Btw - this is a typical (performance) error many developer make: mutex has to be unlocked _before_ notifying...
keeping it as draft for now still need to fill up a description, etc.
All true. I was thinking about having its own thread for init/deinit on macOS. Just never had a chance to get it done.
The later only proves that we cannot unconditionally replace `WriteFile` with `SetOutputReport`, I guess. As for bug "WriteFile() doesn't work correctly" I think we could have a per-device, WinAPI-specific option...