42

iOS中的“锁事” - 简书

 6 years ago
source link: http://www.jianshu.com/p/bd25479b7cd1?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
抛砖引玉 说到锁不得不提线程安全,说到线程安全,作为iOS程序员又不得不提 nonatomic 与 atomic nonatomic 不会对生成的 getter、setter 方法加同步锁(非原子性) atomic 会对生成的 getter 、setter 加同步锁(原子性) setter / getter 被 atomic 修饰的属性时,该属性是读写安全的。然而读写安全并不代表线程安全。 ...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK