title: Multithreading - Calling a function after a specific time by each thread
body: <p>I want all of the threads (in a multithreaded C code running on Linux) to call a function after a specific time . I tried <em>alarm()</em>. It is not thread safe: <em><a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/alarm.html" rel="nofollow">Only one SIGALRM generation can be scheduled in this manner. If the SIGALRM signal has not yet been generated, the call shall result in rescheduling the time at which the SIGALRM signal is generated</a></em>.<br><br>Is there any way to implement such functionality and guarantee that the thread would call the function and leave its current task at that time?</p>