-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: flush_every stops working when adjusting system clock backwards #1200
Comments
Possible (quick and dirty) fix:
↓ See below |
Thanks. Seems very similar #947 isn't it? |
Yes. Can't believe g++ has the same issue. These buggy standard libraries... 😞 |
@gabime Would you like to add a workaround, or leave this to standard library implementors? |
Lets leave it - it will never end if spdlog try to reimplement buggy standard lib features. |
Of course this is out of spdlog's scope! To be helpful, let me post my workaround here, for people who suffer. Then we can close this issue. |
Sure. Thanks. if you could make it portable to gcc as well, it would be super! |
spdlog periodic_worker workaround for MSVC https://gist.github.com/kbridge/251808f0cb7411782c3a2ce5f4877287 |
I think I will try someday, or maybe someone else. I'm a Windows programmer. Haven't been working with pthreads for a long time. |
I will leave this open. Its important for users to be aware of this. |
duplicate of #947 |
duplicate of#947 |
Tested using VS2017.
To reproduce:
Similar to issue #609. But caused by MSVC's buggy implementation of
std::condition_variable::wait_for
. (According to cppreference, this function must use a steady clock.)File
periodic_worker-inl.h
:I try to replace
std::mutex
&std::condition_variable
toCRITICAL_SECTION
&CONDITION_VARIABLE
, then the problem disappears.The text was updated successfully, but these errors were encountered: