diff options
| author | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
|---|---|---|
| committer | 1-rafael-1 <[email protected]> | 2025-09-15 20:07:18 +0200 |
| commit | 6bb3d2c0720fa082f27d3cdb70f516058497ec87 (patch) | |
| tree | 5a1e255cff999b00800f203b91a759c720c973e5 /embassy-sync/src/blocking_mutex | |
| parent | eb685574601d98c44faed9a3534d056199b46e20 (diff) | |
| parent | 92a6fd2946f2cbb15359290f68aa360953da2ff7 (diff) | |
Merge branch 'main' into rp2040-rtc-alarm
Diffstat (limited to 'embassy-sync/src/blocking_mutex')
| -rw-r--r-- | embassy-sync/src/blocking_mutex/mod.rs | 1 | ||||
| -rw-r--r-- | embassy-sync/src/blocking_mutex/raw.rs | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/embassy-sync/src/blocking_mutex/mod.rs b/embassy-sync/src/blocking_mutex/mod.rs index a41bc3569..11809c763 100644 --- a/embassy-sync/src/blocking_mutex/mod.rs +++ b/embassy-sync/src/blocking_mutex/mod.rs | |||
| @@ -22,6 +22,7 @@ use self::raw::RawMutex; | |||
| 22 | /// | 22 | /// |
| 23 | /// In all cases, the blocking mutex is intended to be short lived and not held across await points. | 23 | /// In all cases, the blocking mutex is intended to be short lived and not held across await points. |
| 24 | /// Use the async [`Mutex`](crate::mutex::Mutex) if you need a lock that is held across await points. | 24 | /// Use the async [`Mutex`](crate::mutex::Mutex) if you need a lock that is held across await points. |
| 25 | #[derive(Debug)] | ||
| 25 | pub struct Mutex<R, T: ?Sized> { | 26 | pub struct Mutex<R, T: ?Sized> { |
| 26 | // NOTE: `raw` must be FIRST, so when using ThreadModeMutex the "can't drop in non-thread-mode" gets | 27 | // NOTE: `raw` must be FIRST, so when using ThreadModeMutex the "can't drop in non-thread-mode" gets |
| 27 | // to run BEFORE dropping `data`. | 28 | // to run BEFORE dropping `data`. |
diff --git a/embassy-sync/src/blocking_mutex/raw.rs b/embassy-sync/src/blocking_mutex/raw.rs index a8afcad34..50f965e00 100644 --- a/embassy-sync/src/blocking_mutex/raw.rs +++ b/embassy-sync/src/blocking_mutex/raw.rs | |||
| @@ -37,6 +37,7 @@ pub unsafe trait RawMutex { | |||
| 37 | /// # Safety | 37 | /// # Safety |
| 38 | /// | 38 | /// |
| 39 | /// This mutex is safe to share between different executors and interrupts. | 39 | /// This mutex is safe to share between different executors and interrupts. |
| 40 | #[derive(Debug)] | ||
| 40 | pub struct CriticalSectionRawMutex { | 41 | pub struct CriticalSectionRawMutex { |
| 41 | _phantom: PhantomData<()>, | 42 | _phantom: PhantomData<()>, |
| 42 | } | 43 | } |
| @@ -65,6 +66,7 @@ unsafe impl RawMutex for CriticalSectionRawMutex { | |||
| 65 | /// # Safety | 66 | /// # Safety |
| 66 | /// | 67 | /// |
| 67 | /// **This Mutex is only safe within a single executor.** | 68 | /// **This Mutex is only safe within a single executor.** |
| 69 | #[derive(Debug)] | ||
| 68 | pub struct NoopRawMutex { | 70 | pub struct NoopRawMutex { |
| 69 | _phantom: PhantomData<*mut ()>, | 71 | _phantom: PhantomData<*mut ()>, |
| 70 | } | 72 | } |
