3#ifndef MYTHSYSTEM_UNIX_H
4#define MYTHSYSTEM_UNIX_H
16#include <QWaitCondition>
28using MSMap_t = QMap<pid_t, QPointer<MythSystemLegacyUnix> >;
30using MSList_t = QList<QPointer<MythSystemLegacyUnix> >;
36 :
MThread(QString(
"SystemIOHandler%1").arg(
read ?
"R" :
"W")),
39 void run(
void)
override;
41 void insert(
int fd, QBuffer *buff);
70 void run(
void)
override;
85 :
MThread(
"SystemSignalManager") {}
87 void run(
void)
override;
101 void Manage(
void)
override;
104 void Signal(
int sig)
override;
107 bool ParseShell(
const QString &cmd, QString &abscmd,
108 QStringList &
args)
override;
118 std::array<int,3> m_stdpipe {-1, -1, -1};
This is a wrapper around QThread that does several additional things.
bool wait(std::chrono::milliseconds time=std::chrono::milliseconds::max())
Wait for the MThread to exit, with a maximum timeout.
void HandleWrite(int fd, QBuffer *buff)
MythSystemLegacyIOHandler(bool read)
void insert(int fd, QBuffer *buff)
~MythSystemLegacyIOHandler() override
void HandleRead(int fd, QBuffer *buff)
std::array< char, 65536 > m_readbuf
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
~MythSystemLegacyManager() override
MythSystemLegacyManager()
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
void append(MythSystemLegacyUnix *ms)
virtual void Fork(std::chrono::seconds timeout)=0
virtual void Signal(int sig)=0
virtual void Term(bool force=false)=0
virtual bool ParseShell(const QString &cmd, QString &abscmd, QStringList &args)=0
virtual void JumpAbort(void)=0
virtual void Manage(void)=0
~MythSystemLegacySignalManager() override
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
MythSystemLegacySignalManager()
~MythSystemLegacyUnix() override=default
std::chrono::time_point< SystemClock > SystemTime
QList< QPointer< MythSystemLegacyUnix > > MSList_t
QMap< int, QBuffer * > PMap_t
QMap< pid_t, QPointer< MythSystemLegacyUnix > > MSMap_t
def read(device=None, features=[])