提交 e4bca6ff 编写于 作者: D dev@win10Host.com

Merge branch 'master' of git@gitcode.net:coloreaglestdio/taskbus.git

...@@ -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 (ProcePRIO_MAXss ID: %u)\n", szProcessName, processID );
CloseHandle( hProcess ); CloseHandle( hProcess );
if (info->pid==0) if (info->pid==0)
......
...@@ -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;
} }
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册