From df9e662b50af5c03ff1fd43b6ebf1dd4ae5fb33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20van=20Dorst?= Date: Tue, 22 Oct 2024 22:09:24 +0200 Subject: [PATCH] Add documentation --- embassy-executor/src/arch/std.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/embassy-executor/src/arch/std.rs b/embassy-executor/src/arch/std.rs index 4ddf8b80b..e2cd4929e 100644 --- a/embassy-executor/src/arch/std.rs +++ b/embassy-executor/src/arch/std.rs @@ -64,12 +64,26 @@ mod thread { } } + /// `Signaler` is used in `__pender()`; + /// + /// This is only needed when creating a [`raw::Executor`]. + /// + /// # Example + /// ```rust + /// let signaler = Box::leak(Box::new(Signaler::new())); + /// let executor = &*Box::leak(Box::new(Executor::new(signaler))); + /// + /// executor.spawner().spawn(/* EmbassyTask(Arguments) */).unwrap(); + /// + /// unsafe { executor.poll() }; + /// ``` pub struct Signaler { mutex: Mutex, condvar: Condvar, } impl Signaler { + /// Create a new Signaler. pub fn new() -> Self { Self { mutex: Mutex::new(false),