modified: makefile
[GalaxyCodeBases.git] / BGI / SOAPcoverage / threadmanager.h
blobc15012356763048259929f1a113d58dbd7632438
1 #include<vector>
2 #include<unistd.h>
3 #include<pthread.h>
4 #include<sys/time.h>
6 using namespace std;
8 #ifndef _THREADMANAGER_H_
9 #define _THREADMANAGER_H_
11 typedef void* (*pthreadproc)(void*);
13 class CThreadManager
15 public:
16 CThreadManager();
17 CThreadManager(int cpu);
18 ~CThreadManager();
20 void AddThread(pthreadproc pProc, void* param);
21 void Run();
22 void SetTimer(float t = 0.5);
23 void Reset();
24 void SetCPU(int count);
25 private:
26 public:
27 vector<pthreadproc> m_vproc;
28 vector<void*> m_vparam;
29 int m_cpu;
30 int m_nmaxthread;
31 int m_nindex;
33 protected:
34 private:
35 float m_ftimer;
38 // ThreadParam
39 struct THRPARAM
41 CThreadManager* pMgr;
42 int flag;
45 #endif