2 ms·
I think it may become even easier with C++20 and the addition of wait/notify to std::atomic https://en.cppreference.com/w/cpp/atomic/atomic/wait https://en.cpp
by RcouF1uZ4gsC 5y ago
I think it may become even easier with C++20 and the addition of wait/notify to std::atomic
https://en.cppreference.com/w/cpp/atomic/atomic/wait https://en.cppreference.com/w/cpp/atomic/atomic/wait
- Kranar 5y agoThat is a great way to implement a lock, but it won't be a spin lock (which is a good thing by the way). The wait function is a blocking call.