- m_stop_flag = false;
- pthread_mutex_init(&m_mutex_input_data, 0);
- pthread_cond_init(&m_cond_input_data, 0);
- pthread_mutex_init(&m_mutex_output_data, 0);
- pthread_create(&m_thread_id, 0, tfunc, this);
+ m_p->m_stop_flag = false;
+ pthread_mutex_init(&m_p->m_mutex_input_data, 0);
+ pthread_cond_init(&m_p->m_cond_input_data, 0);
+ pthread_mutex_init(&m_p->m_mutex_output_data, 0);
+
+ m_p->m_no_threads = no_threads;
+ m_p->m_thread_id = new pthread_t[no_threads];
+ int i;
+ for (i = 0; i<m_p->m_no_threads; i++)
+ pthread_create(&m_p->m_thread_id[i], 0, tfunc, this);
+#endif