We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eba3228 commit 52371f4Copy full SHA for 52371f4
library/std/src/sys/unix/thread.rs
@@ -164,16 +164,23 @@ impl Thread {
164
}
165
166
167
+ #[cfg(target_os = "haiku")]
168
+ pub fn set_name(name: &CStr) {
169
+ unsafe {
170
+ let thread_self = libc::find_thread(ptr::null_mut());
171
+ libc::rename_thread(thread_self, name.as_ptr());
172
+ }
173
174
+
175
#[cfg(any(
176
target_env = "newlib",
- target_os = "haiku",
177
target_os = "l4re",
178
target_os = "emscripten",
179
target_os = "redox",
180
target_os = "vxworks"
181
))]
182
pub fn set_name(_name: &CStr) {
- // Newlib, Haiku, Emscripten, and VxWorks have no way to set a thread name.
183
+ // Newlib, Emscripten, and VxWorks have no way to set a thread name.
184
185
186
pub fn sleep(dur: Duration) {
0 commit comments