aboutsummaryrefslogtreecommitdiff
path: root/embassy-sync
diff options
context:
space:
mode:
authorMatteo Meluzzi <[email protected]>2025-10-02 10:53:31 +0200
committerMatteo Meluzzi <[email protected]>2025-10-02 10:53:31 +0200
commit828a8df18d04877df1f55f04354980b28ff2f2f8 (patch)
treec4fa405f5eba7a14b6d435d6cc746c9e0dc52632 /embassy-sync
parent176649e71ad442ca9856af6c11989b0b2f228c4b (diff)
parent194a721d0eab929a2af0a2a4e45ca8e70e0d3f0a (diff)
Merge branch 'main' into 17-add-support-for-boot-protocol
Diffstat (limited to 'embassy-sync')
-rw-r--r--embassy-sync/Cargo.toml2
-rw-r--r--embassy-sync/src/blocking_mutex/mod.rs4
-rw-r--r--embassy-sync/src/blocking_mutex/raw.rs4
-rw-r--r--embassy-sync/src/rwlock.rs2
-rw-r--r--embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr8
5 files changed, 10 insertions, 10 deletions
diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml
index 6494da727..64d76baba 100644
--- a/embassy-sync/Cargo.toml
+++ b/embassy-sync/Cargo.toml
@@ -27,6 +27,8 @@ src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-sync/
27target = "thumbv7em-none-eabi" 27target = "thumbv7em-none-eabi"
28 28
29[features] 29[features]
30defmt = ["dep:defmt"]
31log = ["dep:log"]
30std = [] 32std = []
31turbowakers = [] 33turbowakers = []
32 34
diff --git a/embassy-sync/src/blocking_mutex/mod.rs b/embassy-sync/src/blocking_mutex/mod.rs
index 11809c763..62bfc26fb 100644
--- a/embassy-sync/src/blocking_mutex/mod.rs
+++ b/embassy-sync/src/blocking_mutex/mod.rs
@@ -135,9 +135,9 @@ impl<T> Mutex<raw::NoopRawMutex, T> {
135// There's still a ThreadModeRawMutex for use with the generic Mutex (handy with Channel, for example), 135// There's still a ThreadModeRawMutex for use with the generic Mutex (handy with Channel, for example),
136// but that will require T: Send even though it shouldn't be needed. 136// but that will require T: Send even though it shouldn't be needed.
137 137
138#[cfg(any(cortex_m, feature = "std"))] 138#[cfg(any(cortex_m, doc, feature = "std"))]
139pub use thread_mode_mutex::*; 139pub use thread_mode_mutex::*;
140#[cfg(any(cortex_m, feature = "std"))] 140#[cfg(any(cortex_m, doc, feature = "std"))]
141mod thread_mode_mutex { 141mod thread_mode_mutex {
142 use super::*; 142 use super::*;
143 143
diff --git a/embassy-sync/src/blocking_mutex/raw.rs b/embassy-sync/src/blocking_mutex/raw.rs
index 50f965e00..fbb9ece15 100644
--- a/embassy-sync/src/blocking_mutex/raw.rs
+++ b/embassy-sync/src/blocking_mutex/raw.rs
@@ -89,7 +89,7 @@ unsafe impl RawMutex for NoopRawMutex {
89 89
90// ================ 90// ================
91 91
92#[cfg(any(cortex_m, feature = "std"))] 92#[cfg(any(cortex_m, doc, feature = "std"))]
93mod thread_mode { 93mod thread_mode {
94 use super::*; 94 use super::*;
95 95
@@ -147,5 +147,5 @@ mod thread_mode {
147 return unsafe { (0xE000ED04 as *const u32).read_volatile() } & 0x1FF == 0; 147 return unsafe { (0xE000ED04 as *const u32).read_volatile() } & 0x1FF == 0;
148 } 148 }
149} 149}
150#[cfg(any(cortex_m, feature = "std"))] 150#[cfg(any(cortex_m, doc, feature = "std"))]
151pub use thread_mode::*; 151pub use thread_mode::*;
diff --git a/embassy-sync/src/rwlock.rs b/embassy-sync/src/rwlock.rs
index 0d784a7dc..e43388c4d 100644
--- a/embassy-sync/src/rwlock.rs
+++ b/embassy-sync/src/rwlock.rs
@@ -37,8 +37,6 @@ struct State {
37/// Use [`NoopRawMutex`](crate::blocking_mutex::raw::NoopRawMutex) when data is only shared between tasks running on the same executor. 37/// Use [`NoopRawMutex`](crate::blocking_mutex::raw::NoopRawMutex) when data is only shared between tasks running on the same executor.
38/// 38///
39/// Use [`ThreadModeRawMutex`](crate::blocking_mutex::raw::ThreadModeRawMutex) when data is shared between tasks running on the same executor but you want a singleton. 39/// Use [`ThreadModeRawMutex`](crate::blocking_mutex::raw::ThreadModeRawMutex) when data is shared between tasks running on the same executor but you want a singleton.
40///
41
42pub struct RwLock<M, T> 40pub struct RwLock<M, T>
43where 41where
44 M: RawMutex, 42 M: RawMutex,
diff --git a/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr b/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr
index daf79ad28..417fb8e31 100644
--- a/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr
+++ b/embassy-sync/tests/ui/sync_impl/lazy_lock_function.stderr
@@ -1,10 +1,10 @@
1error[E0277]: `*const u8` cannot be shared between threads safely 1error[E0277]: `*const u8` cannot be shared between threads safely
2 --> tests/ui/sync_impl/lazy_lock_function.rs:8:16 2 --> tests/ui/sync_impl/lazy_lock_function.rs:8:16
3 | 3 |
46 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; 4 6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) };
5 | -- within this `{closure@$DIR/tests/ui/sync_impl/lazy_lock_function.rs:6:47: 6:49}` 5 | -- within this `{closure@$DIR/tests/ui/sync_impl/lazy_lock_function.rs:6:47: 6:49}`
67 | 6 7 |
78 | check_sync(LazyLock::new(closure_capturing_non_sync_variable)); 7 8 | check_sync(LazyLock::new(closure_capturing_non_sync_variable));
8 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely 8 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely
9 | | 9 | |
10 | required by a bound introduced by this call 10 | required by a bound introduced by this call
@@ -14,7 +14,7 @@ error[E0277]: `*const u8` cannot be shared between threads safely
14note: required because it's used within this closure 14note: required because it's used within this closure
15 --> tests/ui/sync_impl/lazy_lock_function.rs:6:47 15 --> tests/ui/sync_impl/lazy_lock_function.rs:6:47
16 | 16 |
176 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) }; 17 6 | let closure_capturing_non_sync_variable = || unsafe { core::ptr::read(x_ptr) };
18 | ^^ 18 | ^^
19 = note: required for `embassy_sync::lazy_lock::LazyLock<u8, {closure@$DIR/tests/ui/sync_impl/lazy_lock_function.rs:6:47: 6:49}>` to implement `Sync` 19 = note: required for `embassy_sync::lazy_lock::LazyLock<u8, {closure@$DIR/tests/ui/sync_impl/lazy_lock_function.rs:6:47: 6:49}>` to implement `Sync`
20note: required by a bound in `check_sync` 20note: required by a bound in `check_sync`