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

riot-rs-macros: use thread_create_noarg() in thread macro #138

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

kaspar030
Copy link
Collaborator

This PR makes the thread macro use thread_create_raw() instead of thread_create().

While thread_create_raw() is unsafe, this drops the need for the trampoline function.
IMO that makes debugging more natural, as e.g., thread function module::fn_name() ends up called like that in the linker output, and not module::__start_thread_fn_name::trampoline().

src/riot-rs-macros/src/thread.rs Outdated Show resolved Hide resolved
@kaspar030 kaspar030 force-pushed the thread_macro_use_create_raw branch from b9dcd4c to c6b8d31 Compare March 5, 2024 14:51
@kaspar030 kaspar030 force-pushed the thread_macro_use_create_raw branch from c6b8d31 to 9387590 Compare March 5, 2024 15:03
@kaspar030
Copy link
Collaborator Author

Like this?

Copy link
Collaborator

@ROMemories ROMemories left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM.

src/riot-rs-threads/src/lib.rs Show resolved Hide resolved
@kaspar030 kaspar030 changed the title riot-rs-macros: use thread_create_raw() in thread macro riot-rs-macros: use thread_create_noarg() in thread macro Mar 5, 2024
@kaspar030 kaspar030 added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 7781f20 Mar 5, 2024
15 checks passed
@kaspar030 kaspar030 deleted the thread_macro_use_create_raw branch March 5, 2024 15:33
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