Skip to content
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

Implement std::thread-like wrappers around Furi Thread APIs #49

Merged
merged 1 commit into from
May 10, 2023

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Mar 3, 2023

No description provided.

crates/flipperzero/src/furi/thread.rs Outdated Show resolved Hide resolved
crates/flipperzero/src/furi/thread.rs Show resolved Hide resolved
crates/flipperzero/examples/threads.rs Show resolved Hide resolved

/// A unique identifier for a running thread.
#[cfg(feature = "alloc")]
pub struct ThreadId(sys::FuriThreadId);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys::FuriThreadId is really an alias for FreeRTOS's TaskHandle_t. There might be some time that you need this for talking with the low-level FreeRTOS APIs, so you probably want to use #[repr(transparent)] or just make ThreadId a type alias.

where
W: ufmt::uWrite + ?Sized,
{
// TODO: ufmt doesn't provide an impl of uDebug for &str.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems quite the omission. 😦

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream issue is japaric/ufmt#52.

@str4d
Copy link
Contributor Author

str4d commented Apr 30, 2023

Rebased on current main.

@str4d
Copy link
Contributor Author

str4d commented Apr 30, 2023

Force-pushed to fix thread memory freeing and add Builder::enable_heap_trace.

@str4d str4d marked this pull request as ready for review April 30, 2023 14:16
@str4d
Copy link
Contributor Author

str4d commented May 4, 2023

Force-pushed to add logging around the thread waiter logic.

@str4d
Copy link
Contributor Author

str4d commented May 4, 2023

Force-pushed to use the newly-stabilised Arc::into_inner instead of the FreeMan.

@str4d
Copy link
Contributor Author

str4d commented May 4, 2023

Force-pushed to bump the pinned nightly to one where Arc::into_inner is stabilized.

Bumps pinned nightly to one where `Arc::into_inner` is stabilized.
@str4d
Copy link
Contributor Author

str4d commented May 10, 2023

Force-pushed to use sys::c_string!() instead of manually crafting the log messages for the thread waiter.

@str4d str4d merged commit 2682773 into flipperzero-rs:main May 10, 2023
@str4d str4d deleted the thread branch May 10, 2023 01:02
@str4d str4d added this to the v0.9.0 milestone May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants