diff options
Diffstat (limited to 'embassy-executor/src/raw/waker.rs')
| -rw-r--r-- | embassy-executor/src/raw/waker.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/embassy-executor/src/raw/waker.rs b/embassy-executor/src/raw/waker.rs index d0d7b003d..2706f0fdf 100644 --- a/embassy-executor/src/raw/waker.rs +++ b/embassy-executor/src/raw/waker.rs | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | use core::task::{RawWaker, RawWakerVTable, Waker}; | 1 | use core::task::{RawWaker, RawWakerVTable, Waker}; |
| 2 | 2 | ||
| 3 | use super::{wake_task, TaskHeader, TaskRef}; | 3 | use super::{TaskHeader, TaskRef, wake_task}; |
| 4 | 4 | ||
| 5 | static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop); | 5 | static VTABLE: RawWakerVTable = RawWakerVTable::new(clone, wake, wake, drop); |
| 6 | 6 | ||
| @@ -35,7 +35,9 @@ pub fn task_from_waker(waker: &Waker) -> TaskRef { | |||
| 35 | // make sure to compare vtable addresses. Doing `==` on the references | 35 | // make sure to compare vtable addresses. Doing `==` on the references |
| 36 | // will compare the contents, which is slower. | 36 | // will compare the contents, which is slower. |
| 37 | if waker.vtable() as *const _ != &VTABLE as *const _ { | 37 | if waker.vtable() as *const _ != &VTABLE as *const _ { |
| 38 | panic!("Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor.") | 38 | panic!( |
| 39 | "Found waker not created by the Embassy executor. `embassy_time::Timer` only works with the Embassy executor." | ||
| 40 | ) | ||
| 39 | } | 41 | } |
| 40 | // safety: our wakers are always created with `TaskRef::as_ptr` | 42 | // safety: our wakers are always created with `TaskRef::as_ptr` |
| 41 | unsafe { TaskRef::from_ptr(waker.data() as *const TaskHeader) } | 43 | unsafe { TaskRef::from_ptr(waker.data() as *const TaskHeader) } |
