Condvars and atomics do not mix

When using std::condition_variable, there’s an easy to remember rule: all variables accessed in wait predicate must be changed under a mutex. However, this is easy to accidentally violate by throwing atomics in the mix.

This post is much shorter than usual, and it was originally written in 2022 and published on Cohost. Originally my plan was t...
添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论