I\'m trying to implement some cross-platform code in C++11. Part of this code implements a semaphore object using a std::condition_variable. When I need to do a timed wait
Register your active condition variables centrally.
Do some effort to detect the clock error, even if it is a thread spin-locking on the current clock (ick) or some other means.
When you detect a clock error, poke the condition variable.
Now wrap your condition variables in a thin wrapper that also supports detecting the clock slippage. It invokes wait_until but replaces the predicate with one that detects clock slippage, and when that happens breaks out of the wait.
When your implementation is broken, you gotta do what you gotta do.