aboutsummaryrefslogtreecommitdiff
path: root/rtic-sync/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-03-15 19:21:13 +0000
committerGitHub <noreply@github.com>2023-03-15 19:21:13 +0000
commitd18955a13450257c0a7725130beef44f21217138 (patch)
tree5bd060104b7a316cea1870fb4a74503bb8624931 /rtic-sync/src
parente145269914227e0af2fc082c3cf490489b8bc979 (diff)
parentef12ae6b04fa57371507e4ab49f49cb51c30ee4c (diff)
Merge #703
703: fix(rtic-sync): used fully qualified paths in Channel Macro r=korken89 a=Yandrik Other imports with the name `Channel` (e.g. from Embassy) broke this macro. Now they don't. Co-authored-by: Yandrik <me@yandrik.dev>
Diffstat (limited to 'rtic-sync/src')
-rw-r--r--rtic-sync/src/channel.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs
index 8a817c8..b7b5a48 100644
--- a/rtic-sync/src/channel.rs
+++ b/rtic-sync/src/channel.rs
@@ -38,6 +38,7 @@ pub struct Channel<T, const N: usize> {
}
unsafe impl<T, const N: usize> Send for Channel<T, N> {}
+
unsafe impl<T, const N: usize> Sync for Channel<T, N> {}
struct UnsafeAccess<'a, const N: usize> {
@@ -102,7 +103,8 @@ impl<T, const N: usize> Channel<T, N> {
#[macro_export]
macro_rules! make_channel {
($type:path, $size:expr) => {{
- static mut CHANNEL: Channel<$type, $size> = Channel::new();
+ static mut CHANNEL: $crate::channel::Channel<$type, $size> =
+ $crate::channel::Channel::new();
// SAFETY: This is safe as we hide the static mut from others to access it.
// Only this point is where the mutable access happens.
@@ -176,6 +178,7 @@ impl LinkPtr {
}
unsafe impl Send for LinkPtr {}
+
unsafe impl Sync for LinkPtr {}
impl<'a, T, const N: usize> core::fmt::Debug for Sender<'a, T, N> {