import Foundation func g() async {} func f(s: NSMutableString) async { Thread.current.threadDictionary["str"] = s await g() Thread.current.threadDictionary["str"] = s }
(edited)import Foundation func f(s: NSMutableString) async { DispatchQueue.main.async { print(s) } }