-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix set_name in thread mod for NuttX #135991
Conversation
Replace `pthread_set_name_np` with `pthread_setname_np` for NuttX in the `set_name` function, this change aligns the implementation with the correct API available on NuttX This patch ensures thread naming works correctly on NuttX platforms. Signed-off-by: Huang Qi <[email protected]>
LGTM @bors r+ rollup |
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#135971 (Properly report error when object type param default references self) - rust-lang#135977 (Fix `FormattingOptions` instantiation with `Default`) - rust-lang#135985 (Rename test to `unresolvable-upvar-issue-87987.rs` and add some notes) - rust-lang#135991 (Fix set_name in thread mod for NuttX) - rust-lang#136009 (bootstrap: Handle bootstrap lockfile race condition better) - rust-lang#136018 (Use short ty string for move errors) - rust-lang#136027 (Skip suggestions in `derive`d code) - rust-lang#136029 (Bootstrap: Don't move ownership of job object) - rust-lang#136034 (fix(bootstrap): deserialize null as `f64::NAN`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135991 - no1wudi:master, r=thomcc Fix set_name in thread mod for NuttX Replace `pthread_set_name_np` with `pthread_setname_np` for NuttX in the `set_name` function, this change aligns the implementation with the correct API available on NuttX This patch ensures thread naming works correctly on NuttX platforms. See also: https://github.com/rust-lang/libc/blob/0f9f8c91adb0365c0d13b34ec27ac8019818cf1f/src/unix/nuttx/mod.rs#L562 https://github.com/apache/nuttx/blob/8f3a2a6f7645dd95b6a7608b9cde3cb693b118c2/include/pthread.h#L511-L514
@@ -139,7 +144,7 @@ impl Thread { | |||
const TASK_COMM_LEN: usize = 16; | |||
let name = truncate_cstr::<{ TASK_COMM_LEN }>(name); | |||
} else { | |||
// FreeBSD and DragonFly BSD do not enforce length limits. | |||
// FreeBSD, DragonFly, FreeBSD and NuttX do not enforce length limits. |
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.
Why did you write down FreeBSD twice? :)
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.
Oh, sorry, I thought "BSD" referred to "FreeBSD" rather than "Dragonfly BSD". I'll revert it.
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.
Replace
pthread_set_name_np
withpthread_setname_np
for NuttX in theset_name
function, this change aligns the implementation with the correct API available on NuttXThis patch ensures thread naming works correctly on NuttX platforms.
See also:
https://github.com/rust-lang/libc/blob/0f9f8c91adb0365c0d13b34ec27ac8019818cf1f/src/unix/nuttx/mod.rs#L562
https://github.com/apache/nuttx/blob/8f3a2a6f7645dd95b6a7608b9cde3cb693b118c2/include/pthread.h#L511-L514