Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <vector>
- #include <afxmt.h>
- #include <windows.h>
- using namespace std;
- class ThreadManager
- {
- private:
- HANDLE updateThread;
- CCriticalSection m_CritSection;
- vector<HANDLE> threads;
- int maxThreads;
- static DWORD WINAPI updateLoop(LPVOID lpParam);
- public:
- ThreadManager(int max=0); // < 0 indicates no maximum # of threads
- ~ThreadManager();
- void startThread(LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter);
- void terminateAllThreads();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement