version 0.1.9
[fms.git] / include / pthreadwrapper / threadedexecutor.h
diff --git a/include/pthreadwrapper/threadedexecutor.h b/include/pthreadwrapper/threadedexecutor.h
new file mode 100644 (file)
index 0000000..ae488e9
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _pthread_threadedexecutor_\r
+#define _pthread_threadedexecutor_\r
+\r
+#include "noncopyable.h"\r
+#include "runnable.h"\r
+#include <vector>\r
+\r
+namespace PThread\r
+{\r
+\r
+class ThreadedExecutor:public NonCopyable\r
+{\r
+public:\r
+       ThreadedExecutor()              {}\r
+       ~ThreadedExecutor();\r
+\r
+       void Execute(Runnable *runnable);\r
+       \r
+       void Join();\r
+       void Cancel();\r
+\r
+private:\r
+       void CleanupFinished();\r
+       \r
+       std::vector<Thread *> m_threads;\r
+};\r
+\r
+}\r
+\r
+#endif // _pthread_threadedexecutor_\r