I'm using the nanosleep function in a multithreaded program. I'm having nanosleep act as a timer that should be able to be interrupted by another thread if a certain condition passes. I found on a website someone ask a similar question, and they said you can't wakeup from a sleep: http://www.codeguru.com/forum/archive/index.php/t-431651.html
Is this true, or is it just with WinAPI (I'm programming in a UNIX environment)?
If you want to do this, why not just use a timed wait on a condvar?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With