摘要: 对于以下代码: @property (strong, nonatomic) NSTimer *timer; self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerTes 阅读全文
posted @ 2021-02-25 21:45 木子沉雨 阅读(169) 评论(0) 推荐(0) 编辑
摘要: iOS中读写安全方案 读写锁区别于线程锁,读写锁允许多个线程去读,但是去写的时候保证只有一个在写 pthread_rwlock // 初始化锁 pthread_rwlock_init(&_lock, NULL); // 加读锁 pthread_rwlock_rdlock(&_lock); // 尝试 阅读全文
posted @ 2021-02-25 20:38 木子沉雨 阅读(407) 评论(0) 推荐(0) 编辑