@@ -25,9 +25,11 @@ extension WithSpecifiedExecutor {
25
25
}
26
26
27
27
final class NaiveQueueExecutor : SpecifiedExecutor , CustomStringConvertible {
28
+ let name : String
28
29
let queue : DispatchQueue
29
30
30
- init ( _ queue: DispatchQueue ) {
31
+ init ( name: String , _ queue: DispatchQueue ) {
32
+ self . name = name
31
33
self . queue = queue
32
34
}
33
35
@@ -49,7 +51,7 @@ final class NaiveQueueExecutor: SpecifiedExecutor, CustomStringConvertible {
49
51
}
50
52
51
53
var description : Swift . String {
52
- " NaiveQueueExecutor( \( queue ) ) "
54
+ " NaiveQueueExecutor( \( name ) ) "
53
55
}
54
56
}
55
57
@@ -74,8 +76,9 @@ actor MyActor: WithSpecifiedExecutor {
74
76
@main struct Main {
75
77
static func main( ) async {
76
78
print ( " begin " )
77
- let queue = DispatchQueue ( label: " CustomQueue " )
78
- let one = NaiveQueueExecutor ( queue)
79
+ let name = " CustomQueue "
80
+ let queue = DispatchQueue ( label: name)
81
+ let one = NaiveQueueExecutor ( name: name, queue)
79
82
let actor = MyActor ( executor: one)
80
83
await actor . test ( expectedExecutor: one, expectedQueue: queue)
81
84
await actor . test ( expectedExecutor: one, expectedQueue: queue)
@@ -85,9 +88,9 @@ actor MyActor: WithSpecifiedExecutor {
85
88
}
86
89
87
90
// CHECK: begin
88
- // CHECK-NEXT: NaiveQueueExecutor(<OS_dispatch_queue_serial: CustomQueue> ): enqueue
89
- // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(<OS_dispatch_queue_serial: CustomQueue> )
90
- // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(<OS_dispatch_queue_serial: CustomQueue> )
91
- // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(<OS_dispatch_queue_serial: CustomQueue> )
92
- // CHECK-NEXT: NaiveQueueExecutor(<OS_dispatch_queue_serial: CustomQueue> ): after run
91
+ // CHECK-NEXT: NaiveQueueExecutor(CustomQueue): enqueue
92
+ // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(CustomQueue)
93
+ // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(CustomQueue)
94
+ // CHECK-NEXT: MyActor: on executor NaiveQueueExecutor(CustomQueue)
95
+ // CHECK-NEXT: NaiveQueueExecutor(CustomQueue): after run
93
96
// CHECK-NEXT: end
0 commit comments