# Pthread and timeouts question



## ivand58 (Dec 9, 2010)

How to implement 
	
	



```
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) ?


----------



## Alt (Dec 9, 2010)

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


----------

