提交 41da870a authored 作者: Serhij S's avatar Serhij S

scheduling and system tools moved to rtsc

上级 3c81fd0a
...@@ -47,7 +47,7 @@ metrics-exporter-prometheus = { version = "0.16.0", optional = true, default-fea ...@@ -47,7 +47,7 @@ metrics-exporter-prometheus = { version = "0.16.0", optional = true, default-fea
metrics-exporter-scope = { version = "0.2.0", optional = true } metrics-exporter-scope = { version = "0.2.0", optional = true }
metrics = { version = "0.24", optional = true } metrics = { version = "0.24", optional = true }
snmp2 = { version = "0.3", optional = true } snmp2 = { version = "0.3", optional = true }
rtsc = "0.3" rtsc = "^0.3.12"
rvideo = { version = "0.5", optional = true, default-features = false } rvideo = { version = "0.5", optional = true, default-features = false }
rflow = { version = "0.1", optional = true, default-features = false } rflow = { version = "0.1", optional = true, default-features = false }
once_cell = { version = "1.19.0", optional = true } once_cell = { version = "1.19.0", optional = true }
......
...@@ -106,6 +106,7 @@ pub mod io; ...@@ -106,6 +106,7 @@ pub mod io;
pub mod supervisor; pub mod supervisor;
/// Real-time thread functions to work with [`supervisor::Supervisor`] and standalone, Linux only /// Real-time thread functions to work with [`supervisor::Supervisor`] and standalone, Linux only
pub mod thread_rt; pub mod thread_rt;
pub use rtsc::system;
/// State helper functions /// State helper functions
#[cfg(any(feature = "json", feature = "msgpack"))] #[cfg(any(feature = "json", feature = "msgpack"))]
...@@ -153,10 +154,10 @@ pub enum Error { ...@@ -153,10 +154,10 @@ pub enum Error {
RTGetTId(libc::c_int), RTGetTId(libc::c_int),
/// Real-time engine error: unable to set the thread scheduler affinity /// Real-time engine error: unable to set the thread scheduler affinity
#[error("RT sched_setaffinity {0}")] #[error("RT sched_setaffinity {0}")]
RTSchedSetAffinity(libc::c_int), RTSchedSetAffinity(String),
/// Real-time engine error: unable to set the thread scheduler policy /// Real-time engine error: unable to set the thread scheduler policy
#[error("RT sched_setscheduler {0}")] #[error("RT sched_setscheduler {0}")]
RTSchedSetSchduler(libc::c_int), RTSchedSetSchduler(String),
/// Supervisor error: task name is not specified in the thread builder /// Supervisor error: task name is not specified in the thread builder
#[error("Task name must be specified when spawning by a supervisor")] #[error("Task name must be specified when spawning by a supervisor")]
SupervisorNameNotSpecified, SupervisorNameNotSpecified,
...@@ -198,6 +199,9 @@ impl From<rtsc::Error> for Error { ...@@ -198,6 +199,9 @@ impl From<rtsc::Error> for Error {
rtsc::Error::InvalidData(msg) => Error::InvalidData(msg), rtsc::Error::InvalidData(msg) => Error::InvalidData(msg),
rtsc::Error::Failed(msg) => Error::Failed(msg), rtsc::Error::Failed(msg) => Error::Failed(msg),
rtsc::Error::AccessDenied => Error::AccessDenied, rtsc::Error::AccessDenied => Error::AccessDenied,
rtsc::Error::RTSchedSetAffinity(msg) => Error::RTSchedSetAffinity(msg),
rtsc::Error::RTSchedSetScheduler(msg) => Error::RTSchedSetSchduler(msg),
rtsc::Error::IO(err) => Error::IO(err),
} }
} }
} }
...@@ -213,6 +217,9 @@ impl From<Error> for rtsc::Error { ...@@ -213,6 +217,9 @@ impl From<Error> for rtsc::Error {
Error::Timeout => rtsc::Error::Timeout, Error::Timeout => rtsc::Error::Timeout,
Error::InvalidData(msg) => rtsc::Error::InvalidData(msg), Error::InvalidData(msg) => rtsc::Error::InvalidData(msg),
Error::AccessDenied => rtsc::Error::AccessDenied, Error::AccessDenied => rtsc::Error::AccessDenied,
Error::RTSchedSetAffinity(msg) => rtsc::Error::RTSchedSetAffinity(msg),
Error::RTSchedSetSchduler(msg) => rtsc::Error::RTSchedSetScheduler(msg),
Error::IO(err) => rtsc::Error::IO(err),
_ => rtsc::Error::Failed(err.to_string()), _ => rtsc::Error::Failed(err.to_string()),
} }
} }
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论