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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.