From 2d45fab9f36110de95a4e91e78c546c44e82a306 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Fri, 22 Oct 2021 20:00:02 -0600 Subject: impl Send and Sync for IoVec --- src/sys/uio.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/sys/uio.rs b/src/sys/uio.rs index 52324020..125c2e6c 100644 --- a/src/sys/uio.rs +++ b/src/sys/uio.rs @@ -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 Send for IoVec where T: Send {} +unsafe impl Sync for IoVec where T: Sync {} -- cgit v1.2.3