From e8c8cab9e220c878c928e24adf2971ade0f9ede8 Mon Sep 17 00:00:00 2001 From: mjzk Date: Tue, 24 Sep 2024 17:52:17 +0800 Subject: [PATCH] make set_current_thread_priority skipping on Windows rather than warning --- src/lib.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3bd8a37..4f6af5e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -406,18 +406,13 @@ impl DedicatedExecutor { } } -#[cfg(unix)] fn set_current_thread_priority(prio: i32) { // on linux setpriority sets the current thread's priority // (as opposed to the current process). + #[cfg(unix)] unsafe { libc::setpriority(0, 0, prio) }; } -#[cfg(not(unix))] -fn set_current_thread_priority(prio: i32) { - warn!("Setting worker thread priority not supported on this platform"); -} - #[cfg(test)] mod tests { use super::*;