lrbalt / libsoxr-rs

Rust wrapper for libsoxr (resampling library for sounds)
Other
8 stars 2 forks source link

Soxr is not Send but it could be #6

Closed teodly closed 1 year ago

teodly commented 1 year ago

I'm a beginner to Rust so I may be wrong.

According to The Rustonomicon,

Something can safely be Send unless it shares mutable state with something else without enforcing exclusive access to it.

so adding that line to soxr.rs should suffice:

unsafe impl Send for Soxr {}
lrbalt commented 1 year ago

I remember reading somewhere that libsoxr is not thread safe. Therefore I did not add the impl Send. Are you sure that libsoxr is thread safe?

lrbalt commented 1 year ago

"Unfortunately, libSoX uses some global state and is thus not completely thread-safe"

from https://public-inbox.org/sox-devel/000601ce9245$28e30b50$7aa921f0$@symonics.com/T/

Closing for this reason