04 2021 档案
摘要:示范代码 ` func testScenarioA2() throws { var store: Int = 100 DispatchQueue.concurrentPerform(iterations: 1_000_000) { _ in store.negate() _ = store } }
阅读全文
摘要:结构体并不代表线程安全,swift在此上未做保证 func testScenarioA() throws { var store: Int = 0 DispatchQueue.concurrentPerform(iterations: 1_000_000) { i in store = i _ =
阅读全文