Skip to content

Commit 76f208a

Browse files
committed
impl Send and Sync for IoVec
1 parent 57d4c86 commit 76f208a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](https://semver.org/).
66
## [Unreleased] - ReleaseDate
77

88
### Added
9+
10+
- `sys::uio::IoVec` is not `Send` and `Sync`
11+
(#[1582](https://github.com/nix-rust/nix/pull/1582))
12+
913
### Changed
1014
### Fixed
1115

src/sys/uio.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,8 @@ impl<'a> IoVec<&'a mut [u8]> {
221221
}, PhantomData)
222222
}
223223
}
224+
225+
// The only reason IoVec isn't automatically Send+Sync is because libc::iovec
226+
// contains raw pointers.
227+
unsafe impl<T> Send for IoVec<T> where T: Send {}
228+
unsafe impl<T> Sync for IoVec<T> where T: Sync {}

0 commit comments

Comments
 (0)