Avatar
@swift-5.6.3 import Foundation let semaphore = DispatchSemaphore(value: 0) func nonIsolatedFunc() async { print(Thread.isMainThread) } @MainActor func mainIsolatedFunc() async { await nonIsolatedFunc() } Task { await mainIsolatedFunc() semaphore.signal() } semaphore.wait()