c - In pthread, how to make a thread wait for a signal -
my objective create thread reusable , not 1 terminates when reaching end of thread function.
this pseudo code of i'm trying achieve pthreads:
bool dorun = true; void thread_func( void* p ) { while( dorun ) { waitforsignal() // waitforsingleobject // run thread } } i used win32 function waitforsingleobject event in past quite lot , have no idea how implement kind of behavior pthreads.
your appreciated
Comments
Post a Comment