gcc seems to have a problem with sleep_for and sleep_until functions (of namespace std::this_thread). I do some simple example with future and conditional variables. gcc actually uses the System Clock instead of Monotonic Clock and this can cause jumps over time. In my example in some case the clock jumps afterward and my timeout expires immediately.
The Bug should be this GCC Bug 41861
I see that in the future gcc 10 release the bug maybe is resolved, but until the realease of the new version of gcc there is a solution for this problem? Someone have noted that?
UPDATE: This Bug is resolved or not yet in the last compiler version ( GCC 10.2 )?