Avatar
@swift-5.6.3 import Foundation let lock = NSRecursiveLock() func nonIsolatedFunc() async { print(Thread.isMainThread) } @MainActor func mainIsolatedFunc() async { await nonIsolatedFunc() } Task { await mainIsolatedFunc() lock.unlock() } lock.lock()