Skip to content

Commit 3b5e287

Browse files
committed
Catch pthread errors in std::os::horizon::thread::current_priority
1 parent 9119729 commit 3b5e287

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

library/std/src/os/horizon/thread.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ pub fn current_priority() -> i32 {
7272
let mut policy = 0;
7373
let mut sched_param = libc::sched_param { sched_priority: 0 };
7474

75-
unsafe { libc::pthread_getschedparam(thread_id, &mut policy, &mut sched_param) };
75+
let result = unsafe { libc::pthread_getschedparam(thread_id, &mut policy, &mut sched_param) };
76+
assert_eq!(result, 0);
7677

7778
sched_param.sched_priority
7879
}

0 commit comments

Comments
 (0)