Quote:
How can i stop the usleep function from sleeping but continue the program after that? What signal should I send?
|
I mostly agree with the above postings. But there can be valid reasons to sleep (e.g. if it's not for polling).
So to answer the question: any signal that can be catched.
Just register a do-nothing signal-handler for the signal of your choice using sigaction(2). then when your thread has catched the signal, usleep() will return -1 with errno set to EINTR.