impl Sync for DataBlobReader

this is safe for the reason explained in the comment

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-06-18 13:55:28 +02:00 committed by Dietmar Maurer
parent 4a3adc3de8
commit eeaa2c212b
1 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,10 @@ pub struct DataBlobReader<R: Read> {
state: BlobReaderState<R>,
}
// zstd_safe::DCtx is not sync but we are, since
// the only public interface is on mutable reference
unsafe impl<R: Read> Sync for DataBlobReader<R> {}
impl <R: Read> DataBlobReader<R> {
pub fn new(mut reader: R, config: Option<Arc<CryptConfig>>) -> Result<Self, Error> {