7#ifndef YARP_RUN_IMPL_RUNPROCMANAGER_H
8#define YARP_RUN_IMPL_RUNPROCMANAGER_H
11# if !defined(WIN32_LEAN_AND_MEAN)
12# define WIN32_LEAN_AND_MEAN
16# include <sys/types.h>
42int SIGNAL(
int pid,
int signum);
49 int warn_suppress = yarp::run::impl::pipe(
pipe_sync);
67 if (read(
pipe_sync[0], dummy,
sizeof(
char) * 8) <= 0) {
77 PID zombie = yarp::os::impl::wait(
nullptr);
87 yarp::run::Run::CleanZombie(zombie);
99 ssize_t warn_suppress = write(
pipe_sync[1],
"zombie",
sizeof(
char) * (strlen(
"zombie") + 1));
110#define YARPRUN_ERROR -1
135 virtual bool Signal(
int signum);
137 virtual bool Clean();
170 int Signal(std::string& alias,
int signum);
175 void GetHandles(
HANDLE* &lpHandles, DWORD &nCount);
202 FDESC readFromPipeCmdToStdout,
203 FDESC writeToPipeCmdToStdout,
211 std::string& stdioUUID,
215 FDESC readFromPipeStdinToCmd,
216 FDESC writeToPipeStdinToCmd,
217 FDESC readFromPipeCmdToStdout,
218 FDESC writeToPipeCmdToStdout,
224 bool Clean()
override;
243 yarp::os::impl::kill(
mPidStdin, SIGTERM);
256 yarp::os::impl::kill(
mPidCmd, SIGTERM);
269 yarp::os::impl::kill(
mPidCmd, SIGTERM);
272 yarp::os::impl::kill(
mPidStdin, SIGTERM);
335 sprintf(buff,
"%d", x);
336 return std::string(buff);
int SIGNAL(int pid, int signum)
std::string int2String(int x)
YarpRunInfoVector * mStdioVector
virtual ~YarpRunCmdWithStdioInfo()
bool Clean(PID pid, YarpRunProcInfo *&pRef) override
FDESC mWriteToPipeStdinToCmd
FDESC mReadFromPipeCmdToStdout
FDESC mWriteToPipeCmdToStdout
FDESC mReadFromPipeStdinToCmd
int Signal(std::string &alias, int signum)
bool CleanZombie(int zombie)
static const int MAX_PROCESSES
YarpRunInfoVector * m_pStdioMate
YarpRunProcInfo * m_apList[MAX_PROCESSES]
bool IsRunning(std::string &alias)
bool Match(std::string &alias)
virtual ~YarpRunProcInfo()
void setEnv(const std::string &env)
virtual bool Signal(int signum)
virtual bool Clean(PID pid, YarpRunProcInfo *&pRef)
void setCmd(const std::string &cmd)
void run() override
Main body of the new thread.
void onStop() override
Call-back, called while halting the thread (before join).
virtual ~ZombieHunterThread()
A simple collection of objects that can be described and transmitted in a portable way.
A mini-server for performing network communication in the background.
An abstraction for a thread of execution.
bool isStopping()
Returns true if the thread is stopping (Thread::stop has been called).