tdecore
kprocctrl.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __KPROCCTRL_H__
00021 #define __KPROCCTRL_H__
00022
00023 #include <tqvaluelist.h>
00024
00025 #include "kprocess.h"
00026
00027 class TQSocketNotifier;
00028
00039 class TDECORE_EXPORT TDEProcessController : public TQObject
00040 {
00041 Q_OBJECT
00042
00043 public:
00048 static void ref();
00049
00054 static void deref();
00055
00060 static TDEProcessController *theTDEProcessController;
00061
00069 static void theSigCHLDHandler(int signal);
00070
00081 bool waitForProcessExit(int timeout);
00082
00088 void unscheduleCheck();
00089
00095 void rescheduleCheck();
00096
00097
00098
00099
00100
00101
00102
00103
00104 int notifierFd() const;
00105
00109 void addTDEProcess( TDEProcess* );
00113 void removeTDEProcess( TDEProcess* );
00117 void addProcess( int pid );
00118
00119 private slots:
00120 void slotDoHousekeeping();
00121
00122 private:
00123 friend class I_just_love_gcc;
00124
00125 int fd[2];
00126 bool needcheck;
00127 TQSocketNotifier *notifier;
00128 TQValueList<TDEProcess*> kProcessList;
00129 TQValueList<int> unixProcessList;
00130
00131 static void setupHandlers();
00132 static void resetHandlers();
00133 static struct sigaction oldChildHandlerData;
00134 static bool handlerSet;
00135
00136 static int refCount;
00137
00138
00139 TDEProcessController();
00140 ~TDEProcessController();
00141
00142
00143 TDEProcessController( const TDEProcessController& );
00144 TDEProcessController& operator= ( const TDEProcessController& );
00145 };
00146
00147
00148
00149 #endif
00150