implement Send on encoder and decoder wrappers
Make API more convenient to use.
Thank you for your pull request!
I see that you've proposed adding an unsafe impl Send for Decode/EncodeWrapper's. Given the potential risks associated with unsafe code and multi-threading, could you please provide a safety comment in the code?
It would be helpful to explain why this implementation is safe, particularly in light of the following considerations:
- The (libwebp) seems not to mention specific guarantees regarding thread safety for the components used in this struct.
The Decoder and Encoder in this library manage the access to the pointer, and don't expose any concurrent safety hazards. But wondering if the transfer between threads itself is ok.
But wondering if the transfer between threads itself is ok.
Tbh I'm not totally sure either. Send is usually ok, but if you do not know about this either it may be best to check with libwebp upstream.
Thanks. I'll try to check it out. Agreed, Send should be ok here but want to err on the safe side.