Skip to content

Commit fc4d6c8

Browse files
committed
[concurrency] Add UnownedJob._runSynchronously(on:) to support running a job synchronously on an executor.
I am going to use this to test that we propagate synchronous accesses into asynchronous tasks access sets. To ensure this is not ABI, I underscored/marked this as alwaysEmitIntoClient.
1 parent ff6b67c commit fc4d6c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,23 @@
1313
import Swift
1414
@_implementationOnly import _SwiftConcurrencyShims
1515

16+
@available(SwiftStdlib 5.5, *)
17+
@_silgen_name("swift_job_run")
18+
@usableFromInline
19+
internal func _swiftJobRun(_ job: UnownedJob,
20+
_ executor: UnownedSerialExecutor) -> ()
21+
1622
/// A job is a unit of scheduleable work.
1723
@available(SwiftStdlib 5.5, *)
1824
@frozen
1925
public struct UnownedJob {
2026
private var context: Builtin.Job
27+
28+
@_alwaysEmitIntoClient
29+
@inlinable
30+
public func _runSynchronously(on executor: UnownedSerialExecutor) {
31+
_swiftJobRun(self, executor)
32+
}
2133
}
2234

2335
@available(SwiftStdlib 5.5, *)

0 commit comments

Comments
 (0)