Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
RoboPLC
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄新宇
RoboPLC
Commits
41da870a
提交
41da870a
authored
1月 06, 2025
作者:
Serhij S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scheduling and system tools moved to rtsc
上级
3c81fd0a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
3 行删除
+10
-3
Cargo.toml
Cargo.toml
+1
-1
lib.rs
src/lib.rs
+9
-2
thread_rt.rs
src/thread_rt.rs
+0
-0
没有找到文件。
Cargo.toml
浏览文件 @
41da870a
...
@@ -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
}
...
...
src/lib.rs
浏览文件 @
41da870a
...
@@ -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
()),
}
}
}
}
...
...
src/thread_rt.rs
浏览文件 @
41da870a
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论