Pthread and timeouts question

How to implement
Code:
void * do_it_fast(void * )
, so that I can wait in the main thread for the child to complete for a fixed interval of time (like software watchdog) ?
 
You can try using mutex inside a thread and control when it done via pthread_mutex_timedlock or pthread_mutex_trylock. Or, you can use pthread_cond_timedwait like in this example
 
Back
Top