diff options
| -rw-r--r-- | embassy-executor/src/raw/run_queue.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/embassy-executor/src/raw/run_queue.rs b/embassy-executor/src/raw/run_queue.rs index 97d26a18a..1eb5775d8 100644 --- a/embassy-executor/src/raw/run_queue.rs +++ b/embassy-executor/src/raw/run_queue.rs | |||
| @@ -170,12 +170,12 @@ impl<T: Linked<cordyceps::stack::Links<T>>> MutexTransferStack<T> { | |||
| 170 | 170 | ||
| 171 | /// Push an item to the transfer stack, returning whether the stack was previously empty | 171 | /// Push an item to the transfer stack, returning whether the stack was previously empty |
| 172 | fn push_was_empty(&self, item: T::Handle, token: super::state::Token) -> bool { | 172 | fn push_was_empty(&self, item: T::Handle, token: super::state::Token) -> bool { |
| 173 | /// SAFETY: The critical-section mutex guarantees that there is no *concurrent* access | 173 | // SAFETY: The critical-section mutex guarantees that there is no *concurrent* access |
| 174 | /// for the lifetime of the token, but does NOT protect against re-entrant access. | 174 | // for the lifetime of the token, but does NOT protect against re-entrant access. |
| 175 | /// However, we never *return* the reference, nor do we recurse (or call another method | 175 | // However, we never *return* the reference, nor do we recurse (or call another method |
| 176 | /// like `take_all`) that could ever allow for re-entrant aliasing. Therefore, the | 176 | // like `take_all`) that could ever allow for re-entrant aliasing. Therefore, the |
| 177 | /// presence of the critical section is sufficient to guarantee exclusive access to | 177 | // presence of the critical section is sufficient to guarantee exclusive access to |
| 178 | /// the `inner` field for the purposes of this function | 178 | // the `inner` field for the purposes of this function. |
| 179 | let mut guard = unsafe { &mut *self.inner.borrow(token).get() }; | 179 | let mut guard = unsafe { &mut *self.inner.borrow(token).get() }; |
| 180 | let is_empty = guard.is_empty(); | 180 | let is_empty = guard.is_empty(); |
| 181 | guard.push(item); | 181 | guard.push(item); |
| @@ -184,12 +184,12 @@ impl<T: Linked<cordyceps::stack::Links<T>>> MutexTransferStack<T> { | |||
| 184 | 184 | ||
| 185 | fn take_all(&self) -> cordyceps::Stack<T> { | 185 | fn take_all(&self) -> cordyceps::Stack<T> { |
| 186 | critical_section::with(|cs| { | 186 | critical_section::with(|cs| { |
| 187 | /// SAFETY: The critical-section mutex guarantees that there is no *concurrent* access | 187 | // SAFETY: The critical-section mutex guarantees that there is no *concurrent* access |
| 188 | /// for the lifetime of the token, but does NOT protect against re-entrant access. | 188 | // for the lifetime of the token, but does NOT protect against re-entrant access. |
| 189 | /// However, we never *return* the reference, nor do we recurse (or call another method | 189 | // However, we never *return* the reference, nor do we recurse (or call another method |
| 190 | /// like `push_was_empty`) that could ever allow for re-entrant aliasing. Therefore, the | 190 | // like `push_was_empty`) that could ever allow for re-entrant aliasing. Therefore, the |
| 191 | /// presence of the critical section is sufficient to guarantee exclusive access to | 191 | // presence of the critical section is sufficient to guarantee exclusive access to |
| 192 | /// the `inner` field for the purposes of this function | 192 | // the `inner` field for the purposes of this function. |
| 193 | let mut guard = unsafe { &mut *self.inner.borrow(cs).get() }; | 193 | let mut guard = unsafe { &mut *self.inner.borrow(cs).get() }; |
| 194 | guard.take_all() | 194 | guard.take_all() |
| 195 | }) | 195 | }) |
