Avatar
多分0388以前は caller 側でhopする実装になってるんだろう (edited)
👍 1
12:09 AM
通常のactorで試そう
12:15 AM
@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)