diff --git a/Runtimes/Core/Concurrency/CMakeLists.txt b/Runtimes/Core/Concurrency/CMakeLists.txt index b4e90e1f9b2cf..65f9ca7ea92ed 100644 --- a/Runtimes/Core/Concurrency/CMakeLists.txt +++ b/Runtimes/Core/Concurrency/CMakeLists.txt @@ -82,6 +82,7 @@ add_library(swift_Concurrency PlatformExecutorDarwin.swift PlatformExecutorLinux.swift PlatformExecutorFreeBSD.swift + PlatformExecutorOpenBSD.swift PlatformExecutorWindows.swift PriorityQueue.swift SourceCompatibilityShims.swift diff --git a/stdlib/public/Concurrency/CMakeLists.txt b/stdlib/public/Concurrency/CMakeLists.txt index 66c9cb82b36df..611c525e6e666 100644 --- a/stdlib/public/Concurrency/CMakeLists.txt +++ b/stdlib/public/Concurrency/CMakeLists.txt @@ -164,6 +164,7 @@ set(SWIFT_RUNTIME_CONCURRENCY_SWIFT_SOURCES PlatformExecutorDarwin.swift PlatformExecutorLinux.swift PlatformExecutorWindows.swift + PlatformExecutorOpenBSD.swift PlatformExecutorFreeBSD.swift ) diff --git a/stdlib/public/Concurrency/PlatformExecutorOpenBSD.swift b/stdlib/public/Concurrency/PlatformExecutorOpenBSD.swift new file mode 100644 index 0000000000000..4bd2db9d5ebdc --- /dev/null +++ b/stdlib/public/Concurrency/PlatformExecutorOpenBSD.swift @@ -0,0 +1,25 @@ +//===----------------------------------------------------------------------===// +// +// 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(OpenBSD) + +import Swift + +// The default executors for now are Dispatch-based +@available(SwiftStdlib 6.2, *) +public struct PlatformExecutorFactory: ExecutorFactory { + public static let mainExecutor: any MainExecutor = DispatchMainExecutor() + public static let defaultExecutor: any TaskExecutor + = DispatchGlobalTaskExecutor() +} + +#endif