04 2021 档案

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

点击右上角即可分享
微信分享提示