Avatar
Avatar
omochimetaru
@swift-5.9.2 -Xfrontend -parse-as-library import Foundation func nonIsolatedFunc() async { let thread = (Thread.current.threadDictionary["thread"] as? String) ?? "runtime thread" print("\(thread) at \(#function)") } actor A { func actorMethod() async { Thread.current.threadDictionary["thread"] = "actor thread" await nonIsolatedFunc() } } @main struct Main { static func main() async { let a = A() await a.actorMethod() } } (edited)
actor thread at nonIsolatedFunc() (edited)