Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Send and Sync for IoVec #1582

Merged
merged 1 commit into from Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).

- Added `fexecve` on DragonFly.
(#[1577](https://github.com/nix-rust/nix/pull/1577))
- `sys::uio::IoVec` is now `Send` and `Sync`
(#[1582](https://github.com/nix-rust/nix/pull/1582))
- Added fine-grained features flags. Most Nix functionality can now be
conditionally enabled. By default, all features are enabled.
(#[1611](https://github.com/nix-rust/nix/pull/1611))
Expand Down
5 changes: 5 additions & 0 deletions src/sys/uio.rs
Expand Up @@ -228,3 +228,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 {}