ruabmbua / hidapi-rs

Rust bindings for the hidapi C library
MIT License
172 stars 81 forks source link

fix(replace `static mut` with `static AtomicBool`) #35

Closed niklasad1 closed 5 years ago

niklasad1 commented 5 years ago

Hey, this replaces global static mut with AtomicBool which is thread-safe

ruabmbua commented 5 years ago

Thanks for the contribution! You probably figured out, that the whole API is not threadsafe (does not implement Sync), but still, the acquiring of the API guard should be threadsafe.