Skip to content

Commit 6c6c576

Browse files
bors[bot]asomers
andauthored
1582: impl Send and Sync for IoVec r=rtzoeller a=asomers Co-authored-by: Alan Somers <[email protected]>
2 parents 5f71467 + 2d45fab commit 6c6c576

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
88

99
- Added `fexecve` on DragonFly.
1010
(#[1577](https://github.com/nix-rust/nix/pull/1577))
11+
- `sys::uio::IoVec` is now `Send` and `Sync`
12+
(#[1582](https://github.com/nix-rust/nix/pull/1582))
1113
- Added fine-grained features flags. Most Nix functionality can now be
1214
conditionally enabled. By default, all features are enabled.
1315
(#[1611](https://github.com/nix-rust/nix/pull/1611))

src/sys/uio.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,8 @@ impl<'a> IoVec<&'a mut [u8]> {
228228
}, PhantomData)
229229
}
230230
}
231+
232+
// The only reason IoVec isn't automatically Send+Sync is because libc::iovec
233+
// contains raw pointers.
234+
unsafe impl<T> Send for IoVec<T> where T: Send {}
235+
unsafe impl<T> Sync for IoVec<T> where T: Sync {}

0 commit comments

Comments
 (0)