Avatar
Avatar
Iceman
@swift-5.5.3 -warn-concurrency import Foundation func f2() async -> Int { 42 } class Nanika { var value = 0 func f() async { let _ = await f2() value += 1 print(value) } } let nanika = Nanika() for _ in 0..<10 { Task.detached { await nanika.f() } } sleep(1) (edited)
1 2 3 4 5 6 7 8 9 10 (edited)