You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The volatile keyword in C++11 ISO Standard code is to be used only for hardware access; do not use it for inter-thread communication. For inter-thread communication, use mechanisms such as std::atomic from the C++ Standard Library.
原文:
notified 为一个标志位,定义在上文,如下:
C++11 ISO 标准代码中的 volatile 关键字仅用于硬件访问,不该用作多线程中。在本文中,虽然它勉强与标题有点关系,但是这个例子并不合适。并且在我看来有其错误的暗示,暗示 volatile 在多线程环境中使用它是有意义的。
见微软文档:
cppreference:
The text was updated successfully, but these errors were encountered: