My objective is to create a thread that is reusable and not one that terminates when reaching the end of the thread function.
This is a pseudo code of what I'm trying to achieve with pthreads:
bool doRun = true;
void thread_func( void* p ) {
while( doRun ) {
waitForSignal() // just like waitForSingleObject
// run thread
}
}
I used the win32 function waitForSingleObject together with an Event in the past quite a lot and I have no idea how to implement that kind of behavior with pthreads.
Your help is appreciated