--- /dev/null
+#ifndef _threadcontroller_\r
+#define _threadcontroller_\r
+\r
+#include "pthreadwrapper/thread.h"\r
+#include "pthreadwrapper/singleton.h"\r
+\r
+class ThreadController:public PThread::Singleton<ThreadController>\r
+{\r
+public:\r
+ ThreadController():m_freenetthread(NULL),m_httpthread(NULL),m_nntpthread(NULL) {}\r
+ ~ThreadController();\r
+\r
+ void StartThreads();\r
+ void ShutdownThreads();\r
+ void RestartThreads();\r
+\r
+ void StartFreenetThread();\r
+ void StartHTTPThread();\r
+ void StartNNTPThread();\r
+\r
+ void ShutdownFreenetThread();\r
+ void ShutdownHTTPThread();\r
+ void ShutdownNNTPThread();\r
+\r
+private:\r
+ void ReadConfig();\r
+\r
+ bool m_startfreenet;\r
+ bool m_starthttp;\r
+ bool m_startnntp;\r
+\r
+ PThread::Thread *m_freenetthread;\r
+ PThread::Thread *m_httpthread;\r
+ PThread::Thread *m_nntpthread;\r
+\r
+};\r
+\r
+#endif // _threadcontroller_\r