@@ -179,12 +179,12 @@ public actor QueuedTask<TaskDescription: TaskDescriptionProtocol> {
179
179
180
180
/// A callback that will be called when the task starts executing, is cancelled to be rescheduled, or when it finishes
181
181
/// execution.
182
- private let executionStateChangedCallback : ( @Sendable ( QueuedTask, TaskExecutionState) async -> Void ) ?
182
+ private let executionStateChangedCallback : ( @Sendable ( QueuedTask , TaskExecutionState ) -> Void ) ?
183
183
184
184
init(
185
185
priority: TaskPriority ,
186
186
description: TaskDescription ,
187
- executionStateChangedCallback: ( @Sendable ( QueuedTask, TaskExecutionState) async -> Void ) ?
187
+ executionStateChangedCallback: ( @Sendable ( QueuedTask , TaskExecutionState ) -> Void ) ?
188
188
) async {
189
189
self . _priority = AtomicUInt8 ( initialValue: priority. rawValue)
190
190
self . description = description
@@ -238,7 +238,7 @@ public actor QueuedTask<TaskDescription: TaskDescriptionProtocol> {
238
238
executionTask = task
239
239
executionTaskCreatedContinuation. yield ( task)
240
240
_isExecuting. value = true
241
- await executionStateChangedCallback ? ( self , . executing)
241
+ executionStateChangedCallback ? ( self , . executing)
242
242
return await task. value
243
243
}
244
244
@@ -247,11 +247,11 @@ public actor QueuedTask<TaskDescription: TaskDescriptionProtocol> {
247
247
self . executionTask = nil
248
248
_isExecuting. value = false
249
249
if Task . isCancelled && self . cancelledToBeRescheduled {
250
- await executionStateChangedCallback ? ( self , . cancelledToBeRescheduled)
250
+ executionStateChangedCallback ? ( self , . cancelledToBeRescheduled)
251
251
self . cancelledToBeRescheduled = false
252
252
return ExecutionTaskFinishStatus . cancelledToBeRescheduled
253
253
} else {
254
- await executionStateChangedCallback ? ( self , . finished)
254
+ executionStateChangedCallback ? ( self , . finished)
255
255
return ExecutionTaskFinishStatus . terminated
256
256
}
257
257
}
@@ -352,7 +352,7 @@ public actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
352
352
priority: TaskPriority ? = nil ,
353
353
_ taskDescription: TaskDescription ,
354
354
@_inheritActorContext executionStateChangedCallback: (
355
- @Sendable ( QueuedTask < TaskDescription > , TaskExecutionState ) async -> Void
355
+ @Sendable ( QueuedTask < TaskDescription > , TaskExecutionState ) -> Void
356
356
) ? = nil
357
357
) async -> QueuedTask < TaskDescription > {
358
358
let queuedTask = await QueuedTask (
0 commit comments