Make RecvFuture sync

RecvFuture always locks the underlying Channel when polled.
This commit is contained in:
Ulf Lilleengen 2021-08-02 11:18:59 +02:00
parent 332bc44b8c
commit 4d8d8e386f

View File

@ -218,6 +218,16 @@ where
} }
} }
// Safe to pass the receive future around since it locks channel whenever polled
unsafe impl<'ch, M, T, const N: usize> Send for RecvFuture<'ch, M, T, N> where
M: Mutex<Data = ()> + Sync
{
}
unsafe impl<'ch, M, T, const N: usize> Sync for RecvFuture<'ch, M, T, N> where
M: Mutex<Data = ()> + Sync
{
}
impl<'ch, M, T, const N: usize> Sender<'ch, M, T, N> impl<'ch, M, T, const N: usize> Sender<'ch, M, T, N>
where where
M: Mutex<Data = ()>, M: Mutex<Data = ()>,