22 #ifndef ThreadCreator_h_
23 #define ThreadCreator_h_
25 #include <Poco/Thread.h>
26 #include <sys/resource.h>
27 #include <sys/types.h>
86 template<
class ThreadMaster>
95 typedef void(ThreadMaster::*
Action)(void);
100 inline Poco::Thread::TID getTID()
const
114 void sleep(
long milliseconds );
116 inline bool isRunning()
const
118 return thr.isRunning();
126 inline void setFinalAction( ThreadMaster* m,
Action a )
132 inline void setInitialAction( ThreadMaster* m,
Action a )
148 virtual void initial()
154 virtual void terminate() {}
159 ThreadMaster* m = {
nullptr };
162 ThreadMaster* finm = {
nullptr };
165 ThreadMaster* initm = {
nullptr };
172 template <
class ThreadMaster>
173 ThreadCreator<ThreadMaster>::ThreadCreator( ThreadMaster* m, Action a ):
183 template <
class ThreadMaster>
184 void ThreadCreator<ThreadMaster>::run()
194 template <
class ThreadMaster>
195 void ThreadCreator<ThreadMaster>::stop()
200 template <
class ThreadMaster>
201 void ThreadCreator<ThreadMaster>::start()
206 template <
class ThreadMaster>
207 void ThreadCreator<ThreadMaster>::sleep(
long milliseconds )
209 thr.sleep(milliseconds);
212 template <
class ThreadMaster>
213 ThreadCreator<ThreadMaster>::ThreadCreator():
223 template <
class ThreadMaster>
224 ThreadCreator<ThreadMaster>::~ThreadCreator()
228 template <
class ThreadMaster>
231 return thr.setPriority(prior);
234 template <
class ThreadMaster>
237 return thr.getPriority();
Definition: ThreadCreator.h:89
void(ThreadMaster::* Action)(void)
Definition: ThreadCreator.h:95
void setPriority(Poco::Thread::Priority prior)
Definition: ThreadCreator.h:229
Poco::Thread::Priority getPriority() const
Definition: ThreadCreator.h:235
Definition: CommonEventLoop.h:15