Skip to content

Commit abe377c

Browse files
authored
[Workaround][Concurrency] Mark Job as NOT moveonly until we fix moveonly types (#64536)
1 parent 42c69cc commit abe377c

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

stdlib/public/Concurrency/PartialAsyncTask.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ extension UnownedJob: CustomStringConvertible {
105105
}
106106

107107
#if !SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
108-
//// A unit of scheduleable work.
108+
/// A unit of scheduleable work.
109109
///
110110
/// Unless you're implementing a scheduler,
111111
/// you don't generally interact with jobs directly.
112112
@available(SwiftStdlib 5.9, *)
113113
@frozen
114-
@_moveOnly
114+
// @_moveOnly // FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
115115
public struct Job: Sendable {
116116
internal var context: Builtin.Job
117117

test/Concurrency/Runtime/custom_executors_moveOnly_job.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
// REQUIRES: concurrency
44
// REQUIRES: executable_test
55

6-
// rdar://106849189 move-only types should be supported in freestanding mode
6+
// FIXME(moveonly): rdar://106849189 move-only types should be supported in freestanding mode
77
// UNSUPPORTED: freestanding
88

99
// UNSUPPORTED: back_deployment_runtime
1010
// REQUIRES: concurrency_runtime
1111

1212
final class InlineExecutor: SerialExecutor, CustomStringConvertible {
13-
public func enqueue(_ job: __owned Job) {
13+
// FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
14+
// public func enqueue(_ job: __owned Job) {
15+
// job.runSynchronously(on: self.asUnownedSerialExecutor())
16+
// }
17+
public func enqueue(_ job: UnownedJob) {
1418
job.runSynchronously(on: self.asUnownedSerialExecutor())
1519
}
1620

test/Concurrency/Runtime/custom_executors_priority.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
// REQUIRES: concurrency_runtime
1111

1212
final class InlineExecutor: SerialExecutor {
13-
public func enqueue(_ job: __owned Job) {
13+
// FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
14+
// public func enqueue(_ job: __owned Job) {
15+
// print("\(self): enqueue (priority: \(TaskPriority(job.priority)!))")
16+
// job.runSynchronously(on: self.asUnownedSerialExecutor())
17+
// }
18+
public func enqueue(_ job: UnownedJob) {
1419
print("\(self): enqueue (priority: \(TaskPriority(job.priority)!))")
1520
job.runSynchronously(on: self.asUnownedSerialExecutor())
1621
}

test/Concurrency/Runtime/custom_executors_protocol.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,17 @@ final class NaiveQueueExecutor: SpecifiedExecutor, CustomStringConvertible {
3535
self.queue = queue
3636
}
3737

38-
public func enqueue(_ job: __owned Job) {
38+
// FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
39+
// public func enqueue(_ job: __owned Job) {
40+
// print("\(self): enqueue")
41+
// let unowned = UnownedJob(job)
42+
// queue.sync {
43+
// unowned.runSynchronously(on: self.asUnownedSerialExecutor())
44+
// }
45+
// print("\(self): after run")
46+
// }
47+
public func enqueue(_ unowned: UnownedJob) {
3948
print("\(self): enqueue")
40-
let unowned = UnownedJob(job)
4149
queue.sync {
4250
unowned.runSynchronously(on: self.asUnownedSerialExecutor())
4351
}

test/Concurrency/custom_executor_enqueue_impls.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// RUN: %target-typecheck-verify-swift -enable-experimental-move-only -disable-availability-checking
22
// REQUIRES: concurrency
33

4-
// rdar://106849189 move-only types should be supported in freestanding mode
4+
// FIXME(moveonly): rdar://106849189 move-only types should be supported in freestanding mode
55
// UNSUPPORTED: freestanding
66

7+
// FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
8+
// REQUIRES: radr107050387
9+
710
// Such type may be encountered since Swift 5.5 (5.1 backdeployed) if someone implemented the
811
// not documented, but public Executor types back then already.
912
//

test/IRGen/async/builtin_executor.sil

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
// RUN: %target-swift-frontend -primary-file %s -module-name=test -disable-llvm-optzns -disable-swift-specific-llvm-optzns -emit-ir -sil-verify-all | %IRGenFileCheck %s
22

33
// REQUIRES: concurrency
4-
// rdar://106849189 move-only types should be supported in freestanding mode
4+
// FIXME(moveonly): rdar://106849189 move-only types should be supported in freestanding mode
55
// UNSUPPORTED: freestanding
66

7+
// FIXME(moveonly): rdar://107050387 Move-only types fail to be found sometimes, must fix or remove Job before shipping
8+
// REQUIRES: radr107050387
9+
710
sil_stage canonical
811

912
import Builtin

0 commit comments

Comments
 (0)