Skip to content

Commit 1f1dbb5

Browse files
committed
try fix for setname
1 parent 6a2cd0d commit 1f1dbb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/std/src/sys/pal/unix/thread.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl Thread {
235235

236236
let name = truncate_cstr::<{ VX_TASK_NAME_LEN }>(name);
237237
let status = unsafe { f(libc::taskIdSelf(), name.as_mut_ptr()) };
238-
debug_assert_eq!(res, libc::OK);
238+
debug_assert_eq!(status, libc::OK);
239239
}
240240
}
241241

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

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

0 commit comments

Comments
 (0)