Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
不卤废丝
taskbus
提交
e4bca6ff
taskbus
项目概览
不卤废丝
/
taskbus
与 Fork 源项目一致
Fork自
colorEagleStdio / taskbus
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
taskbus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4bca6ff
编写于
4月 24, 2022
作者:
D
dev@win10Host.com
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git@gitcode.net:coloreaglestdio/taskbus.git
上级
44a60d15
2bf2c821
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
15 deletion
+37
-15
taskbusplatform/core/process_prctl.cpp
taskbusplatform/core/process_prctl.cpp
+7
-7
taskbusplatform/core/process_prctl.h
taskbusplatform/core/process_prctl.h
+2
-2
taskbusplatform/gui/pdesignerview.cpp
taskbusplatform/gui/pdesignerview.cpp
+28
-6
未找到文件。
taskbusplatform/core/process_prctl.cpp
浏览文件 @
e4bca6ff
...
@@ -18,14 +18,14 @@
...
@@ -18,14 +18,14 @@
namespace
TASKBUS
{
namespace
TASKBUS
{
#ifdef WIN32
#ifdef WIN32
const
int
pnice_
min
=
0
;
const
int
pnice_
idle
=
0
;
const
int
pnice_
max
=
5
;
const
int
pnice_
realtime
=
5
;
const
int
pnice_norm
=
2
;
const
int
pnice_norm
=
2
;
#endif
#endif
#ifdef linux
#ifdef linux
const
int
pnice_
min
=
PRIO_MIN
;
const
int
pnice_
idle
=
PRIO_MAX
;
const
int
pnice_
max
=
PRIO_MAX
;
const
int
pnice_
realtime
=
PRIO_MIN
;
const
int
pnice_norm
=
0
;
const
int
pnice_norm
=
0
;
#endif
#endif
...
@@ -56,7 +56,7 @@ namespace TASKBUS {
...
@@ -56,7 +56,7 @@ namespace TASKBUS {
#ifdef linux
#ifdef linux
Q_PID
id
=
p
->
pid
();
Q_PID
id
=
p
->
pid
();
if
(
nice
<
-
PRIO_MIN
)
nice
=
PRIO_MIN
;
if
(
nice
<
PRIO_MIN
)
nice
=
PRIO_MIN
;
if
(
nice
>
PRIO_MAX
)
nice
=
PRIO_MAX
;
if
(
nice
>
PRIO_MAX
)
nice
=
PRIO_MAX
;
setpriority
(
PRIO_PROCESS
,
id
,
nice
);
setpriority
(
PRIO_PROCESS
,
id
,
nice
);
#endif
#endif
...
@@ -82,7 +82,7 @@ namespace TASKBUS {
...
@@ -82,7 +82,7 @@ namespace TASKBUS {
#ifdef linux
#ifdef linux
Q_PID
id
=
getpid
();
Q_PID
id
=
getpid
();
if
(
nice
<
-
PRIO_MIN
)
nice
=
PRIO_MIN
;
if
(
nice
<
PRIO_MIN
)
nice
=
PRIO_MIN
;
if
(
nice
>
PRIO_MAX
)
nice
=
PRIO_MAX
;
if
(
nice
>
PRIO_MAX
)
nice
=
PRIO_MAX
;
setpriority
(
PRIO_PROCESS
,
id
,
nice
);
setpriority
(
PRIO_PROCESS
,
id
,
nice
);
#endif
#endif
...
@@ -190,7 +190,7 @@ namespace TASKBUS {
...
@@ -190,7 +190,7 @@ namespace TASKBUS {
info
->
pid
=
p
;
info
->
pid
=
p
;
}
}
//printf( "%s (Process ID: %u)\n", szProcessName, processID );
//printf( "%s (Proce
PRIO_MAX
ss ID: %u)\n", szProcessName, processID );
CloseHandle
(
hProcess
);
CloseHandle
(
hProcess
);
if
(
info
->
pid
==
0
)
if
(
info
->
pid
==
0
)
...
...
taskbusplatform/core/process_prctl.h
浏览文件 @
e4bca6ff
...
@@ -22,8 +22,8 @@ namespace TASKBUS {
...
@@ -22,8 +22,8 @@ namespace TASKBUS {
bool
get_memory
(
qint64
p
,
tagMemoryInfo
*
info
);
bool
get_memory
(
qint64
p
,
tagMemoryInfo
*
info
);
extern
const
int
pnice_
min
;
extern
const
int
pnice_
idle
;
extern
const
int
pnice_
max
;
extern
const
int
pnice_
realtime
;
extern
const
int
pnice_norm
;
extern
const
int
pnice_norm
;
}
}
...
...
taskbusplatform/gui/pdesignerview.cpp
浏览文件 @
e4bca6ff
...
@@ -773,9 +773,19 @@ void PDesignerView::on_actionNiceUp_triggered()
...
@@ -773,9 +773,19 @@ void PDesignerView::on_actionNiceUp_triggered()
if
(
node
>=
0
&&
node
<
sz
)
if
(
node
>=
0
&&
node
<
sz
)
{
{
int
nic
=
project
()
->
get_nice
(
node
);
int
nic
=
project
()
->
get_nice
(
node
);
++
nic
;
if
(
TASKBUS
::
pnice_realtime
<
TASKBUS
::
pnice_idle
)
if
(
nic
>
TASKBUS
::
pnice_max
)
{
nic
=
TASKBUS
::
pnice_max
;
--
nic
;
if
(
nic
<
TASKBUS
::
pnice_realtime
)
nic
=
TASKBUS
::
pnice_realtime
;
}
else
{
++
nic
;
if
(
nic
>
TASKBUS
::
pnice_realtime
)
nic
=
TASKBUS
::
pnice_realtime
;
}
project
()
->
set_nice
(
node
,
nic
);
project
()
->
set_nice
(
node
,
nic
);
}
}
ui
->
graphicsView_main
->
scale
(
0.5
,
1
);
ui
->
graphicsView_main
->
scale
(
0.5
,
1
);
...
@@ -790,9 +800,21 @@ void PDesignerView::on_actionNiceDown_triggered()
...
@@ -790,9 +800,21 @@ void PDesignerView::on_actionNiceDown_triggered()
if
(
node
>=
0
&&
node
<
sz
)
if
(
node
>=
0
&&
node
<
sz
)
{
{
int
nic
=
project
()
->
get_nice
(
node
);
int
nic
=
project
()
->
get_nice
(
node
);
--
nic
;
if
(
TASKBUS
::
pnice_realtime
<
TASKBUS
::
pnice_idle
)
if
(
nic
<
TASKBUS
::
pnice_min
)
{
nic
=
TASKBUS
::
pnice_min
;
++
nic
;
if
(
nic
>
TASKBUS
::
pnice_idle
)
nic
=
TASKBUS
::
pnice_idle
;
project
()
->
set_nice
(
node
,
nic
);
}
else
{
--
nic
;
if
(
nic
<
TASKBUS
::
pnice_idle
)
nic
=
TASKBUS
::
pnice_idle
;
project
()
->
set_nice
(
node
,
nic
);
}
project
()
->
set_nice
(
node
,
nic
);
project
()
->
set_nice
(
node
,
nic
);
}
}
ui
->
graphicsView_main
->
scale
(
0.5
,
1
);
ui
->
graphicsView_main
->
scale
(
0.5
,
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录