Skip to content

Commit 67e6373

Browse files
committed
[Concurrency] minor renames of new API for adding escalation handlers
1 parent 655bd67 commit 67e6373

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

include/swift/Runtime/Concurrency.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,16 +609,16 @@ SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
609609
void swift_task_removeCancellationHandler(
610610
CancellationNotificationStatusRecord *record);
611611

612-
/// Create and add an escalation record to the task.
612+
/// Create and add an priority escalation record to the task.
613613
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
614614
EscalationNotificationStatusRecord*
615-
swift_task_addEscalationHandler(
615+
swift_task_addPriorityEscalationHandler(
616616
EscalationNotificationStatusRecord::FunctionType handler,
617617
void *handlerContext);
618618

619-
/// Remove the passed cancellation record from the task.
619+
/// Remove the passed priority escalation record from the task.
620620
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
621-
void swift_task_removeEscalationHandler(
621+
void swift_task_removePriorityEscalationHandler(
622622
EscalationNotificationStatusRecord *record);
623623

624624
/// Create a NullaryContinuationJob from a continuation.

stdlib/public/CompatibilityOverride/CompatibilityOverrideConcurrency.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@ OVERRIDE_TASK(task_removeCancellationHandler, void,
206206
SWIFT_EXPORT_FROM(swift_Concurrency), SWIFT_CC(swift), swift::,
207207
(CancellationNotificationStatusRecord *record), (record))
208208

209-
OVERRIDE_TASK(task_addEscalationHandler,
209+
OVERRIDE_TASK(task_addPriorityEscalationHandler,
210210
EscalationNotificationStatusRecord *,
211211
SWIFT_EXPORT_FROM(swift_Concurrency), SWIFT_CC(swift), swift::,
212212
(EscalationNotificationStatusRecord::FunctionType handler,
213213
void *context),
214214
(handler, context))
215215

216-
OVERRIDE_TASK(task_removeEscalationHandler, void,
216+
OVERRIDE_TASK(task_removePriorityEscalationHandler, void,
217217
SWIFT_EXPORT_FROM(swift_Concurrency), SWIFT_CC(swift), swift::,
218218
(EscalationNotificationStatusRecord *record), (record))
219219

stdlib/public/Concurrency/Task.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ static void swift_task_removeCancellationHandlerImpl(
17681768

17691769
SWIFT_CC(swift)
17701770
static EscalationNotificationStatusRecord*
1771-
swift_task_addEscalationHandlerImpl(
1771+
swift_task_addPriorityEscalationHandlerImpl(
17721772
EscalationNotificationStatusRecord::FunctionType handler,
17731773
void *context) {
17741774
void *allocation =
@@ -1785,7 +1785,7 @@ swift_task_addEscalationHandlerImpl(
17851785
}
17861786

17871787
SWIFT_CC(swift)
1788-
static void swift_task_removeEscalationHandlerImpl(
1788+
static void swift_task_removePriorityEscalationHandlerImpl(
17891789
EscalationNotificationStatusRecord *record) {
17901790
removeStatusRecordFromSelf(record);
17911791
swift_task_dealloc(record);

stdlib/public/Concurrency/Task.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,23 +994,23 @@ public func withTaskPriorityEscalationHandler<T, E>(
994994
let handler0: (UInt8) -> Void = {
995995
handler(TaskPriority(rawValue: $0))
996996
}
997-
let record = _taskAddEscalationHandler(handler: handler0)
998-
defer { _taskRemoveEscalationHandler(record: record) }
997+
let record = _taskaddPriorityEscalationHandler(handler: handler0)
998+
defer { _taskremovePriorityEscalationHandler(record: record) }
999999

10001000
return try await operation()
10011001
}
10021002

10031003
@usableFromInline
10041004
@available(SwiftStdlib 9999, *)
1005-
@_silgen_name("swift_task_addEscalationHandler")
1006-
func _taskAddEscalationHandler(
1005+
@_silgen_name("swift_task_addPriorityEscalationHandler")
1006+
func _taskaddPriorityEscalationHandler(
10071007
handler: (UInt8) -> Void
10081008
) -> UnsafeRawPointer /*EscalationNotificationStatusRecord*/
10091009

10101010
@usableFromInline
10111011
@available(SwiftStdlib 9999, *)
1012-
@_silgen_name("swift_task_removeEscalationHandler")
1013-
func _taskRemoveEscalationHandler(
1012+
@_silgen_name("swift_task_removePriorityEscalationHandler")
1013+
func _taskremovePriorityEscalationHandler(
10141014
record: UnsafeRawPointer /*EscalationNotificationStatusRecord*/
10151015
)
10161016

test/Concurrency/async_task_escalate_priority.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ import Darwin
2626
@preconcurrency import Dispatch
2727
import StdlibUnittest
2828

29-
func TESTTEST_taskAddCancellationHandler(handler: () -> Void) {
30-
handler()
31-
}
32-
func TESTTEST_taskAddEscalationHandler(handler: (TaskPriority) -> Void, t: TaskPriority) { handler(t) }
33-
3429
func loopUntil(priority: TaskPriority) async {
3530
var loops = 10
3631
var currentPriority = Task.currentPriority

0 commit comments

Comments
 (0)