diff options
| -rw-r--r-- | embassy-executor/src/raw/mod.rs | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/embassy-executor/src/raw/mod.rs b/embassy-executor/src/raw/mod.rs index 938492c21..0120334b6 100644 --- a/embassy-executor/src/raw/mod.rs +++ b/embassy-executor/src/raw/mod.rs | |||
| @@ -337,15 +337,6 @@ impl SyncExecutor { | |||
| 337 | } | 337 | } |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | /// Spawn a task in this executor. | ||
| 341 | /// | ||
| 342 | /// # Safety | ||
| 343 | /// | ||
| 344 | /// `task` must be a valid pointer to an initialized but not-already-spawned task. | ||
| 345 | /// | ||
| 346 | /// It is OK to use `unsafe` to call this from a thread that's not the executor thread. | ||
| 347 | /// In this case, the task's Future must be Send. This is because this is effectively | ||
| 348 | /// sending the task to the executor thread. | ||
| 349 | pub(super) unsafe fn spawn(&'static self, task: TaskRef) { | 340 | pub(super) unsafe fn spawn(&'static self, task: TaskRef) { |
| 350 | task.header().executor.set(Some(self)); | 341 | task.header().executor.set(Some(self)); |
| 351 | 342 | ||
| @@ -357,23 +348,9 @@ impl SyncExecutor { | |||
| 357 | }) | 348 | }) |
| 358 | } | 349 | } |
| 359 | 350 | ||
| 360 | /// Poll all queued tasks in this executor. | ||
| 361 | /// | ||
| 362 | /// This loops over all tasks that are queued to be polled (i.e. they're | ||
| 363 | /// freshly spawned or they've been woken). Other tasks are not polled. | ||
| 364 | /// | ||
| 365 | /// You must call `poll` after receiving a call to `signal_fn`. It is OK | ||
| 366 | /// to call `poll` even when not requested by `signal_fn`, but it wastes | ||
| 367 | /// energy. | ||
| 368 | /// | ||
| 369 | /// # Safety | 351 | /// # Safety |
| 370 | /// | 352 | /// |
| 371 | /// You must NOT call `poll` reentrantly on the same executor. | 353 | /// Same as [`Executor::poll`], plus you must only call this on the thread this executor was created. |
| 372 | /// | ||
| 373 | /// In particular, note that `poll` may call `signal_fn` synchronously. Therefore, you | ||
| 374 | /// must NOT directly call `poll()` from your `signal_fn`. Instead, `signal_fn` has to | ||
| 375 | /// somehow schedule for `poll()` to be called later, at a time you know for sure there's | ||
| 376 | /// no `poll()` already running. | ||
| 377 | pub(crate) unsafe fn poll(&'static self) { | 354 | pub(crate) unsafe fn poll(&'static self) { |
| 378 | #[allow(clippy::never_loop)] | 355 | #[allow(clippy::never_loop)] |
| 379 | loop { | 356 | loop { |
