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)