Skip to content

Commit

Permalink
impl Send and Sync for IoVec
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Dec 15, 2021
1 parent 87142d2 commit 001b628
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## [Unreleased] - ReleaseDate

### Added

- `sys::uio::IoVec` is not `Send` and `Sync`
(#[1582](https://github.com/nix-rust/nix/pull/1582))

### Changed
### Fixed

Expand Down
5 changes: 5 additions & 0 deletions src/sys/uio.rs
Expand Up @@ -221,3 +221,8 @@ impl<'a> IoVec<&'a mut [u8]> {
}, PhantomData)
}
}

// The only reason IoVec isn't automatically Send+Sync is because libc::iovec
// contains raw pointers.
unsafe impl<T> Send for IoVec<T> where T: Send {}
unsafe impl<T> Sync for IoVec<T> where T: Sync {}

0 comments on commit 001b628

Please sign in to comment.