Skip to content

Commit b265330

Browse files
Merge #149
149: Make Producer<..., SingleCore> Send, like Consumer r=japaric a=BryanKadzban I assume there's no reason that only multi-core Producers are marked Send, while Consumers are not (they're pretty symmetrical). (Context: I'm trying to use an SPSC queue on a single cortex-m0 MCU. So I can guarantee that a SingleCore queue is safe because there is no other core it could possibly be shared with. The RTFM framework adds an assert_send on the producer, since it's shared between init and an SPI receiver interrupt. It also adds an assert_send on the Consumer, since it's shared between init and the I2C transmit interrupt, but that one works since Consumer has this extra C type in the impl already.) Co-authored-by: Bryan Kadzban <github@kadzban.net>
2 parents 82064d0 + de0ef16 commit b265330

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/spsc/split.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,12 @@ where
6161
_marker: PhantomData<&'a ()>,
6262
}
6363

64-
unsafe impl<'a, T, N, U> Send for Producer<'a, T, N, U>
64+
unsafe impl<'a, T, N, U, C> Send for Producer<'a, T, N, U, C>
6565
where
6666
N: ArrayLength<T>,
6767
T: Send,
6868
U: sealed::Uxx,
69+
C: sealed::XCore,
6970
{
7071
}
7172

0 commit comments

Comments
 (0)