CRITICAL_SECTION for set and get single bool value

前端 未结 4 1716
甜味超标
甜味超标 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 11:56

    You cannot guarantee for all implementations/platforms/compilers that bool, or any other type, or most operations, are atomic. So, no, I don't believe your statements are correct. You can retool your logic or use other means of establishing atomicity, but you probably can't get away with just removing CRITICAL_SECTION usage if you rely on it.

提交回复
热议问题