We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 435236b commit 6be2d9aCopy full SHA for 6be2d9a
src/libstd/sys/unix/thread.rs
@@ -122,8 +122,21 @@ impl Thread {
122
name.as_ptr() as *mut libc::c_void);
123
}
124
125
+
126
+ #[cfg(target_os = "solaris")]
127
+ pub fn set_name(name: &CStr) {
128
+ weak! {
129
+ fn pthread_setname_np(
130
+ libc::pthread_t, *const libc::c_char
131
+ ) -> libc::c_int
132
+ }
133
134
+ if let Some(f) = pthread_setname_np.get() {
135
+ unsafe { f(libc::pthread_self(), name.as_ptr()); }
136
137
138
139
#[cfg(any(target_env = "newlib",
- target_os = "solaris",
140
target_os = "haiku",
141
target_os = "l4re",
142
target_os = "emscripten",
0 commit comments