aboutsummaryrefslogtreecommitdiff
path: root/embassy-sync
diff options
context:
space:
mode:
authorPer Rosengren <[email protected]>2025-09-16 19:17:13 +0200
committerPer Rosengren <[email protected]>2025-09-16 19:17:13 +0200
commit42c21a24e590adbfc577ed8afea06abe3fc7b9e9 (patch)
treedc23754b42d532fcb04e7d1877e9bdd87ce5fde7 /embassy-sync
parent4e1e4249556e20907839f09a65ae9283a8490cac (diff)
parent017064138003fa38b52f11dba872a43d4fec8b61 (diff)
Merge remote-tracking branch 'upstream/main' into adc_v3-enums
Diffstat (limited to 'embassy-sync')
-rw-r--r--embassy-sync/CHANGELOG.md1
-rw-r--r--embassy-sync/Cargo.toml2
-rw-r--r--embassy-sync/src/mutex.rs4
3 files changed, 5 insertions, 2 deletions
diff --git a/embassy-sync/CHANGELOG.md b/embassy-sync/CHANGELOG.md
index a53d5f5b1..242b8b7ab 100644
--- a/embassy-sync/CHANGELOG.md
+++ b/embassy-sync/CHANGELOG.md
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8<!-- next-header --> 8<!-- next-header -->
9## Unreleased - ReleaseDate 9## Unreleased - ReleaseDate
10- Fix wakers getting dropped by `Signal::reset` 10- Fix wakers getting dropped by `Signal::reset`
11- Remove `Sized` trait bound from `MutexGuard::map`
11 12
12## 0.7.2 - 2025-08-26 13## 0.7.2 - 2025-08-26
13 14
diff --git a/embassy-sync/Cargo.toml b/embassy-sync/Cargo.toml
index 30a27c13f..6494da727 100644
--- a/embassy-sync/Cargo.toml
+++ b/embassy-sync/Cargo.toml
@@ -17,6 +17,8 @@ categories = [
17[package.metadata.embassy] 17[package.metadata.embassy]
18build = [ 18build = [
19 {target = "thumbv6m-none-eabi", features = ["defmt"]}, 19 {target = "thumbv6m-none-eabi", features = ["defmt"]},
20 # Xtensa builds
21 {group = "xtensa", build-std = ["core", "alloc"], target = "xtensa-esp32s2-none-elf", features = ["defmt"]},
20] 22]
21 23
22[package.metadata.embassy_docs] 24[package.metadata.embassy_docs]
diff --git a/embassy-sync/src/mutex.rs b/embassy-sync/src/mutex.rs
index 4ce6dd987..aea682899 100644
--- a/embassy-sync/src/mutex.rs
+++ b/embassy-sync/src/mutex.rs
@@ -187,7 +187,7 @@ where
187 T: ?Sized, 187 T: ?Sized,
188{ 188{
189 /// Returns a locked view over a portion of the locked data. 189 /// Returns a locked view over a portion of the locked data.
190 pub fn map<U>(this: Self, fun: impl FnOnce(&mut T) -> &mut U) -> MappedMutexGuard<'a, M, U> { 190 pub fn map<U: ?Sized>(this: Self, fun: impl FnOnce(&mut T) -> &mut U) -> MappedMutexGuard<'a, M, U> {
191 let mutex = this.mutex; 191 let mutex = this.mutex;
192 let value = fun(unsafe { &mut *this.mutex.inner.get() }); 192 let value = fun(unsafe { &mut *this.mutex.inner.get() });
193 // Don't run the `drop` method for MutexGuard. The ownership of the underlying 193 // Don't run the `drop` method for MutexGuard. The ownership of the underlying
@@ -279,7 +279,7 @@ where
279 T: ?Sized, 279 T: ?Sized,
280{ 280{
281 /// Returns a locked view over a portion of the locked data. 281 /// Returns a locked view over a portion of the locked data.
282 pub fn map<U>(this: Self, fun: impl FnOnce(&mut T) -> &mut U) -> MappedMutexGuard<'a, M, U> { 282 pub fn map<U: ?Sized>(this: Self, fun: impl FnOnce(&mut T) -> &mut U) -> MappedMutexGuard<'a, M, U> {
283 let state = this.state; 283 let state = this.state;
284 let value = fun(unsafe { &mut *this.value }); 284 let value = fun(unsafe { &mut *this.value });
285 // Don't run the `drop` method for MutexGuard. The ownership of the underlying 285 // Don't run the `drop` method for MutexGuard. The ownership of the underlying