support uthread on windows with msvc#467
Conversation
| auto f = [&taskEx, &taskNotify]() mutable { | ||
| Latch latch(1u); | ||
| taskNotify.schedule([latchPtr = &latch]() mutable { | ||
| std::this_thread::sleep_for(1us); |
There was a problem hiding this comment.
std::this_thread::sleep_for with durations less than one millisecond on Windows gets rounded up to the system timer tick, which is typically around 1ms to 15.6ms, causing tests to run slower on Windows.
| // needed here. | ||
| #else | ||
| #warning "Backtracing from uthreads may be broken" | ||
| #error "Backtracing from uthreads may be broken" |
There was a problem hiding this comment.
warning is fine. Uthread is not a necessary part of the library.
There was a problem hiding this comment.
Unfortunately, #warning is standardized in C++23, so it cannot be used in MSVC with C++20 : (
And I believe this line is unreachable for all platforms that support uthread.
There was a problem hiding this comment.
If it is unreachable, let's remove it.
There was a problem hiding this comment.
Perhaps we could change it to assert(false, "...")?
There was a problem hiding this comment.
It is the same thing with #error here. Let's land it, I don't want nitpicking
Why
related: #451
What is changing
Example