|
|
@ -224,19 +224,16 @@ struct PThreadAttr { |
|
|
|
|
|
|
|
|
|
|
|
impl Default for PThreadAttr { |
|
|
|
impl Default for PThreadAttr { |
|
|
|
fn default() -> Self { |
|
|
|
fn default() -> Self { |
|
|
|
let thread_id = unsafe { libc::pthread_self() }; |
|
|
|
// Note: we are ignoring the result here, but errors shouldn't occur
|
|
|
|
let mut policy = 0; |
|
|
|
// since we're using a valid handle.
|
|
|
|
let mut sched_param = libc::sched_param { sched_priority: 0 }; |
|
|
|
let mut priority = 0; |
|
|
|
|
|
|
|
unsafe { ctru_sys::svcGetThreadPriority(&mut priority, ctru_sys::CUR_THREAD_HANDLE) }; |
|
|
|
unsafe { libc::pthread_getschedparam(thread_id, &mut policy, &mut sched_param) }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let priority = sched_param.sched_priority; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PThreadAttr { |
|
|
|
PThreadAttr { |
|
|
|
stack_size: libc::PTHREAD_STACK_MIN, |
|
|
|
stack_size: libc::PTHREAD_STACK_MIN, |
|
|
|
|
|
|
|
|
|
|
|
// If no priority value is specified, spawn with the same
|
|
|
|
// If no priority value is specified, spawn with the same priority
|
|
|
|
// priority as the current thread
|
|
|
|
// as the current thread
|
|
|
|
priority, |
|
|
|
priority, |
|
|
|
|
|
|
|
|
|
|
|
// If no processor is specified, spawn on the default core.
|
|
|
|
// If no processor is specified, spawn on the default core.
|
|
|
|