Merge pull request #239 from la-ninpre/master

Add support for other BSDs
This commit is contained in:
Revertron
2022-04-12 23:39:14 +02:00
committed by GitHub
2 changed files with 5 additions and 14 deletions
+2 -5
View File
@@ -52,11 +52,8 @@ open = { version = "2.1.1", optional = true }
winapi = { version = "0.3.9", features = ["impl-default", "wincon", "shellscalingapi"] } winapi = { version = "0.3.9", features = ["impl-default", "wincon", "shellscalingapi"] }
thread-priority = "0.8.0" thread-priority = "0.8.0"
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies]
thread-priority = "0.8.0" thread-priority = "0.8.2"
[target.'cfg(target_os = "openbsd")'.dependencies]
thread-priority = "0.8.1"
[build-dependencies] [build-dependencies]
winres = "0.1.12" winres = "0.1.12"
+3 -9
View File
@@ -3,7 +3,7 @@ use std::num;
pub use constants::*; pub use constants::*;
use rand::Rng; use rand::Rng;
#[cfg(not(target_os = "macos"))] #[cfg(not(any(target_os = "macos", target_os = "dragonfly")))]
use thread_priority::*; use thread_priority::*;
use crate::dns::protocol::DnsRecord; use crate::dns::protocol::DnsRecord;
@@ -139,19 +139,13 @@ pub fn setup_miner_thread(cpu: u32) {
//let _ = set_current_thread_ideal_processor(IdealProcessor::from(cpu)); //let _ = set_current_thread_ideal_processor(IdealProcessor::from(cpu));
} }
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "openbsd", target_os = "freebsd", target_os = "netbsd"))]
#[allow(unused_variables)] #[allow(unused_variables)]
pub fn setup_miner_thread(cpu: u32) { pub fn setup_miner_thread(cpu: u32) {
let _ = set_current_thread_priority(ThreadPriority::Min); let _ = set_current_thread_priority(ThreadPriority::Min);
} }
#[cfg(target_os = "openbsd")] #[cfg(any(target_os = "macos", target_os = "dragonfly"))]
#[allow(unused_variables)]
pub fn setup_miner_thread(cpu: u32) {
let _ = set_current_thread_priority(ThreadPriority::Min);
}
#[cfg(target_os = "macos")]
#[allow(unused_variables)] #[allow(unused_variables)]
pub fn setup_miner_thread(cpu: u32) { pub fn setup_miner_thread(cpu: u32) {
// MacOS is not supported by thread_priority crate // MacOS is not supported by thread_priority crate