Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added Send+Sync to MutableBuffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Sep 2, 2021
1 parent cef5f08 commit ec1462f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/buffer/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,8 @@ impl MutableBuffer<u8> {
MutableBuffer::from_trusted_len_iter_unchecked(iter).into()
}
}

// This is sound because `NativeType` is `Send+Sync`, and
// `MutableBuffer` has the invariants of `Vec<T>` (which is `Send+Sync`)
unsafe impl<T: NativeType> Send for MutableBuffer<T> {}
unsafe impl<T: NativeType> Sync for MutableBuffer<T> {}

0 comments on commit ec1462f

Please sign in to comment.