If you are programming for Windows, you could use the WaitForSingleObject or WaitForMultipleObjects api's.

This is something like sleep_until(condition=1).