d1190c85c725648e37b9bdc0b8c785a8a987fc70
[fms.git] / include / threadcontroller.h
1 #ifndef _threadcontroller_\r
2 #define _threadcontroller_\r
3 \r
4 #include "pthreadwrapper/thread.h"\r
5 #include "pthreadwrapper/singleton.h"\r
6 \r
7 class ThreadController:public PThread::Singleton<ThreadController>\r
8 {\r
9 public:\r
10         ThreadController():m_freenetthread(NULL),m_httpthread(NULL),m_nntpthread(NULL)          {}\r
11         ~ThreadController();\r
12 \r
13         void StartThreads();\r
14         void ShutdownThreads();\r
15         void RestartThreads();\r
16 \r
17         void StartFreenetThread();\r
18         void StartHTTPThread();\r
19         void StartNNTPThread();\r
20 \r
21         void ShutdownFreenetThread();\r
22         void ShutdownHTTPThread();\r
23         void ShutdownNNTPThread();\r
24 \r
25 private:\r
26         void ReadConfig();\r
27 \r
28         bool m_startfreenet;\r
29         bool m_starthttp;\r
30         bool m_startnntp;\r
31 \r
32         PThread::Thread *m_freenetthread;\r
33         PThread::Thread *m_httpthread;\r
34         PThread::Thread *m_nntpthread;\r
35 \r
36 };\r
37 \r
38 #endif  // _threadcontroller_\r