Android: Debug assertion after setting thread name

This commit is contained in:
Yoh Deadfall 2024-10-05 21:29:40 +03:00
parent 8885239786
commit 2223328d16

View File

@ -117,13 +117,15 @@ pub fn yield_now() {
pub fn set_name(name: &CStr) {
const PR_SET_NAME: libc::c_int = 15;
unsafe {
libc::prctl(
let res = libc::prctl(
PR_SET_NAME,
name.as_ptr(),
0 as libc::c_ulong,
0 as libc::c_ulong,
0 as libc::c_ulong,
);
// We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
debug_assert_eq!(res, 0);
}
}