ruabmbua / hidapi-rs

Rust bindings for the hidapi C library
MIT License
175 stars 82 forks source link

Fix incorrect compare_and_swap check #36

Closed jleni closed 5 years ago

jleni commented 5 years ago

At the moment (v0.5.1) valid calls to acquire fail. Any application using this library will fail to acquire an API handle.

compare_and_swap returns the previous value so in this case a valid lock results into an InitializationError

ruabmbua commented 5 years ago

Thanks!