Generally, the hidapi based communication should be single-threaded, as on macOS, we have seen communication issues when the hidapi calls move between threads. See https://github.com/libusb/hidapi/issues/503.
The above issue is unresolved and unexplained, and might only happen in combination with the Go runtime, Nevertheless, it is safer to use it only single-threaded, to avoid potential issues.
This commit enables Sync+Send (multithreading) by activating the "multithreaded" feature for when multithreading is required. Sync/Send cannot be activated in WASM as the function pointers in JsReadWrite do not implement Sync/Send.
Generally, the hidapi based communication should be single-threaded, as on macOS, we have seen communication issues when the hidapi calls move between threads. See https://github.com/libusb/hidapi/issues/503.
The above issue is unresolved and unexplained, and might only happen in combination with the Go runtime, Nevertheless, it is safer to use it only single-threaded, to avoid potential issues.
This commit enables Sync+Send (multithreading) by activating the "multithreaded" feature for when multithreading is required. Sync/Send cannot be activated in WASM as the function pointers in JsReadWrite do not implement Sync/Send.