mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Reorganise the Concurrency code so that it's possible to completely implement executors (both main and global) in Swift. Provide API to choose the desired executors for your application. Also make `Task.Sleep` wait using the current executor, not the global executor, and expose APIs on `Clock` to allow for conversion between time bases. rdar://141348916
22 lines
747 B
Swift
22 lines
747 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if !$Embedded && os(Linux)
|
|
|
|
import Swift
|
|
|
|
// The default executors for now are Dispatch-based
|
|
typealias PlatformMainExecutor = DispatchMainExecutor
|
|
typealias PlatformDefaultExecutor = DispatchTaskExecutor
|
|
|
|
#endif // os(Linux)
|