CRITICAL_SECTION for set and get single bool value

前端 未结 4 1714
甜味超标
甜味超标 2021-01-19 11:20

now writing complicated class and felt that I use to much CRITICAL_SECTION.

As far as I know there are atomic operations for some types, th

4条回答
  •  自闭症患者
    2021-01-19 12:07

    1. You don't need locks round atomic data, but internally they might lock. Note for example, C++11's std::atomic has a is_lock_free function.
    2. bool may not be atomic. See here and here

提交回复
热议问题