1#ifndef QX_PROCCESSBIDER_P_H
2#define QX_PROCCESSBIDER_P_H
11#include <qx/core/qx-exclusiveaccess.h>
20#include "__private/qx-processwaiter_win.h"
23#include "__private/qx-processwaiter_linux.h"
30class ProcessBiderWorker :
public QObject
35 enum Outcome { HookFail, GraceExpired, Abandoned };
42 std::chrono::milliseconds mPollRate;
44 std::chrono::milliseconds mGrace;
49 ProcessWaiter mWaiter;
54 explicit ProcessBiderWorker();
58 void startWait(quint32 pid);
61 void handleGraceEnd(
bool retry);
62 void finish(Outcome outcome);
65 void setProcessName(
const QString& name);
67 void setPollRate(std::chrono::milliseconds rate);
69 void setGrace(std::chrono::milliseconds grace);
70 void setStartWithGrace(
bool graceFirst);
74 void handleProcesStop();
78 void handleClosure(std::chrono::milliseconds timeout,
bool force);
84 void processStopped();
85 void processCloseFailed();
87 void complete(Outcome outcome);
92class ProcessBiderManager
97 static inline constinit QMutex smMutex;
106 explicit ProcessBiderManager();
110 ~ProcessBiderManager();
118 void startThreadIfStopped();
119 void stopThreadIfStarted(
bool wait =
false);
122 void registerBider(ProcessBider* bider);
123 void notifyWorkerFinished();
The ExclusiveAccess template class is a convenience class that simplifies access to resources secured...
Definition qx-exclusiveaccess.h:16
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5