-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(threads): delay thread start until init_task()
has finished
#526
base: main
Are you sure you want to change the base?
Conversation
@@ -49,6 +49,13 @@ pub mod macro_reexports { | |||
pub use static_cell; | |||
} | |||
|
|||
#[doc(hidden)] | |||
pub mod _events { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub mod _events { | |
pub mod events { |
_foo
means that it's unused, not that it is private or "not to be used by users"
_ => panic!(r#"neither "riot-rs" nor "riot-rs-threads" found in dependencies!"#), | ||
} | ||
}; | ||
|
||
let expanded = quote! { | ||
#no_mangle_attr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#no_mangle_attr | |
#no_mangle_attr | |
#[inline(always)] |
Not saying that I know better than the compiler, but maybe in this case it can be useful, so that it gets inlined inside the trampoline function?
#[doc(hidden)] | ||
pub mod _events { | ||
use crate::sync::Event; | ||
// this is set in `riot_rs_embassy::init_task()`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// this is set in `riot_rs_embassy::init_task()`` | |
// this is set in `riot_rs_embassy::init_task()` |
Description
This PR adds infra to make threads wait for system initialization (
riot_rs_embassy::init_task()
) to complete before starting.This makes some code easier, e.g.,
asynch::spawner()
to be populatedembedded-test
integration (WIP) #361 tests can assume a set up systemBasically, it allows threads to assume a sane system state.
Issues/PRs references
See also #509.
Open Questions
Change checklist