27 #ifndef _THREAD_POOL_H
28 #define _THREAD_POOL_H
39 std::vector<HANDLE> m_threads;
43 thread_group(
const thread_group & src) { }
52 for(std::vector<HANDLE>::const_iterator i = m_threads.begin(); i!= m_threads.end(); ++i)
61 hThread = CreateThread(NULL,
67 if(hThread != INVALID_HANDLE_VALUE)
68 m_threads.push_back(hThread);
69 return hThread != INVALID_HANDLE_VALUE;
76 ::WaitForMultipleObjects(m_threads.size(), &m_threads[0], TRUE, INFINITE);
84 std::vector<pthread_t> m_threads;
105 int ret = pthread_create(&thread, 0,
108 m_threads.push_back(thread);
116 for(std::vector<pthread_t>::iterator i = m_threads.begin(); i!=m_threads.end(); ++i)
pthread thread creation params
Definition: function.h:95
Definition: thread_group.h:82
void join_all()
wait all threads terminate
Definition: thread_group.h:114
bool create_thread(const sprint::thread_function &p)
create an additional thread
Definition: thread_group.h:102
~thread_group()
release memory associated to thread
Definition: thread_group.h:95