摘要: 结构体并不代表线程安全,swift在此上未做保证 func testScenarioA() throws { var store: Int = 0 DispatchQueue.concurrentPerform(iterations: 1_000_000) { i in store = i _ = 阅读全文
posted @ 2021-04-02 23:23 兜兜有糖的博客 阅读(56) 评论(0) 推荐(0) 编辑