Skip to content

Commit

Permalink
try fix for setname
Browse files Browse the repository at this point in the history
  • Loading branch information
biabbas committed Aug 7, 2024
1 parent 6a2cd0d commit 1f1dbb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/std/src/sys/pal/unix/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl Thread {

let name = truncate_cstr::<{ VX_TASK_NAME_LEN }>(name);
let status = unsafe { f(libc::taskIdSelf(), name.as_mut_ptr()) };
debug_assert_eq!(res, libc::OK);
debug_assert_eq!(status, libc::OK);
}
}

Expand Down Expand Up @@ -491,7 +491,9 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {

// always fetches a valid bitmask
let set = unsafe { vxCpuEnabledGet() };
Ok(NonZero::new_unchecked(set.count_ones() as usize))
Ok(unsafe{
NonZero::new_unchecked(set.count_ones() as usize)
})
} else {
// FIXME: implement on Redox, l4re
Err(io::const_io_error!(io::ErrorKind::Unsupported, "Getting the number of hardware threads is not supported on the target platform"))
Expand Down

0 comments on commit 1f1dbb5

Please sign in to comment.