在C#中访问bool字段原子?特别是,我需要锁定:
class Foo { private bool _bar; //... in some function on any thread (or many threads) _bar = true; //... same for a read if (_bar) { ... } }
.net c# concurrency boolean locking
.net ×1
boolean ×1
c# ×1
concurrency ×1
locking ×1