UI: RpcManager::sendCommandDataToClients: Set thread busy

This commit is contained in:
Nodir Temirkhodjaev 2023-06-26 13:53:08 +03:00
parent 04dd18d6f0
commit b40baffe54
2 changed files with 12 additions and 1 deletions

View File

@ -175,7 +175,13 @@ bool ControlManager::processRequest(Control::Command command, const QVariantList
OsUtil::setThreadIsBusy(true);
QString errorMessage;
const bool success = processCommand({ w, command, args, errorMessage });
const bool success = processCommand({
.worker = w,
.command = command,
.args = args,
.errorMessage = errorMessage,
});
if (!success) {
qCWarning(LC) << "Bad command" << errorMessage << ':' << command << args;
}

View File

@ -17,6 +17,7 @@
#include <rpc/statmanagerrpc.h>
#include <rpc/taskmanagerrpc.h>
#include <util/ioc/ioccontainer.h>
#include <util/osutil.h>
namespace {
@ -35,6 +36,8 @@ inline bool sendCommandDataToClients(
{
bool ok = true;
OsUtil::setThreadIsBusy(true);
for (ControlWorker *w : clients) {
if (!w->isServiceClient())
continue;
@ -45,6 +48,8 @@ inline bool sendCommandDataToClients(
}
}
OsUtil::setThreadIsBusy(false);
return ok;
}