后台dbus通信修改为同步调用
This commit is contained in:
parent
3b933a87db
commit
747d8495b2
|
@ -30,11 +30,7 @@ AppCGroup::AppCGroup(QObject *parent)
|
|||
QString AppCGroup::createProcessCGroup(const QString &appId, const QList<int> &pids)
|
||||
{
|
||||
auto reply = m_processManagerInterface->CreateProcessCGroup(appId, pids);
|
||||
qDebug() << "reply is finished. " << reply.isFinished();
|
||||
while (!reply.isFinished()) {
|
||||
qApp->processEvents();
|
||||
usleep(10);
|
||||
}
|
||||
reply.waitForFinished();
|
||||
if (reply.isError()) {
|
||||
qWarning() << "createProcessCGroup error, " << reply.error();
|
||||
return QString();
|
||||
|
@ -76,10 +72,7 @@ bool AppCGroup::reclaimProcesses(const QString &cgroupName)
|
|||
QString AppCGroup::cgroupNameWithPid(int pid)
|
||||
{
|
||||
auto reply = m_processManagerInterface->CGroupNameWithPid(pid);
|
||||
while (!reply.isFinished()) {
|
||||
qApp->processEvents();
|
||||
usleep(1);
|
||||
}
|
||||
reply.waitForFinished();
|
||||
if (reply.isError()) {
|
||||
qWarning() << __FUNCTION__ << "error, " << reply.error();
|
||||
return QString();
|
||||
|
|
Loading…
Reference in New Issue