Is there a way to make the current thread sleep for a given amount of time, while having the possibility of another thread "waking it up" earlier?