We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb90f81 commit 29b8593Copy full SHA for 29b8593
library/std/src/sys/unix/thread.rs
@@ -204,7 +204,9 @@ impl Thread {
204
pub fn set_name(name: &CStr) {
205
unsafe {
206
let thread_self = libc::find_thread(ptr::null_mut());
207
- libc::rename_thread(thread_self, name.as_ptr());
+ let res = libc::rename_thread(thread_self, name.as_ptr());
208
+ // We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
209
+ debug_assert_eq!(res, libc::B_OK);
210
}
211
212
0 commit comments