We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug https://developercommunity.visualstudio.com/t/STL-std::this_thread::sleep_for-wont/10327605?port=1025&fsid=e785caac-6a7e-499b-87f5-e731ecbca870
std::this_thread::sleep_for won't return if change the time back
Command-line test case
#include <iostream> #define BOOST_ALL_DYN_LINK 1 #include <boost/chrono.hpp> #include <boost/thread.hpp> int main() { std::thread boost{[]() { for (int i = 0; i < 100; ++i) { boost::this_thread::sleep_for(boost::chrono::seconds(1)); std::cout << "boost: " << i << '\n'; } }}; std::thread stl{[]() { for (int i = 0; i < 100; ++i) { std::this_thread::sleep_for(std::chrono::seconds(1)); std::cout << "STL: " << i << '\n'; } }}; boost.join(); stl.join(); }
Expected behavior Won't block.
STL version Microsoft Visual Studio Community 2022 Version 17.5.3
Microsoft Visual Studio Community 2022 Version 17.5.3
Additional context Boost & gcc-10 no problem.
I think this implementation is terrible:
// msvc 17.5.3 _EXPORT_STD template <class _Rep, class _Period> void sleep_for(const chrono::duration<_Rep, _Period>& _Rel_time) { sleep_until(_To_absolute_time(_Rel_time)); }
The text was updated successfully, but these errors were encountered:
Looks like a duplicate of #718.
Sorry, something went wrong.
Closed due to duplicate of #718.
No branches or pull requests
Describe the bug
https://developercommunity.visualstudio.com/t/STL-std::this_thread::sleep_for-wont/10327605?port=1025&fsid=e785caac-6a7e-499b-87f5-e731ecbca870
std::this_thread::sleep_for won't return if change the time back
Command-line test case
Expected behavior
Won't block.
STL version
Microsoft Visual Studio Community 2022 Version 17.5.3
Additional context
Boost & gcc-10 no problem.
I think this implementation is terrible:
The text was updated successfully, but these errors were encountered: