Skip to content

Commit

Permalink
block_on method
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 9, 2023
1 parent cc3585e commit 0910f47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use core::ptr::{self, NonNull};
use core::sync::atomic::{AtomicBool, Ordering};
use core::task::{Context, Poll};

#[cfg(feature = "alloc")]
extern crate alloc;

use esp_idf_sys::*;

use crate::cpu::Core;
Expand Down Expand Up @@ -218,6 +221,7 @@ pub fn get_idle_task(core: crate::cpu::Core) -> TaskHandle_t {
}

/// Executes the supplied future on the current thread, thus blocking it until the future becomes ready.
#[cfg(feature = "alloc")]
pub fn block_on<F>(mut fut: F) -> F::Output
where
F: Future,
Expand Down

0 comments on commit 0910f47

Please sign in to comment.