Skip to content

Fix pointer auth issues for discarding task group operation pointer #65220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions stdlib/public/Concurrency/DiscardingTaskGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ public struct DiscardingTaskGroup {
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
#endif
public mutating func addTask(
public mutating func addTask<DiscardedResult>(
priority: TaskPriority? = nil,
operation: __owned @Sendable @escaping () async -> Void
operation: __owned @Sendable @escaping () async -> DiscardedResult
) {
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
let flags = taskCreateFlags(
Expand Down Expand Up @@ -206,9 +206,9 @@ public struct DiscardingTaskGroup {
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
#endif
public mutating func addTaskUnlessCancelled(
public mutating func addTaskUnlessCancelled<DiscardedResult>(
priority: TaskPriority? = nil,
operation: __owned @Sendable @escaping () async -> Void
operation: __owned @Sendable @escaping () async -> DiscardedResult
) -> Bool {
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)

Expand Down Expand Up @@ -237,8 +237,8 @@ public struct DiscardingTaskGroup {
}

@_alwaysEmitIntoClient
public mutating func addTask(
operation: __owned @Sendable @escaping () async -> Void
public mutating func addTask<DiscardedResult>(
operation: __owned @Sendable @escaping () async -> DiscardedResult
) {
let flags = taskCreateFlags(
priority: nil, isChildTask: true, copyTaskLocals: false,
Expand All @@ -260,8 +260,8 @@ public struct DiscardingTaskGroup {
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTaskUnlessCancelled(operation:)")
#endif
@_alwaysEmitIntoClient
public mutating func addTaskUnlessCancelled(
operation: __owned @Sendable @escaping () async -> Void
public mutating func addTaskUnlessCancelled<DiscardedResult>(
operation: __owned @Sendable @escaping () async -> DiscardedResult
) -> Bool {
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
Expand Down Expand Up @@ -547,9 +547,9 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
#endif
@_alwaysEmitIntoClient
public mutating func addTask(
public mutating func addTask<DiscardedResult>(
priority: TaskPriority? = nil,
operation: __owned @Sendable @escaping () async throws -> Void
operation: __owned @Sendable @escaping () async throws -> DiscardedResult
) {
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
let flags = taskCreateFlags(
Expand All @@ -569,9 +569,9 @@ public struct ThrowingDiscardingTaskGroup<Failure: Error> {
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model", renamed: "addTask(operation:)")
#endif
@_alwaysEmitIntoClient
public mutating func addTaskUnlessCancelled(
public mutating func addTaskUnlessCancelled<DiscardedResult>(
priority: TaskPriority? = nil,
operation: __owned @Sendable @escaping () async throws -> Void
operation: __owned @Sendable @escaping () async throws -> DiscardedResult
) -> Bool {
#if compiler(>=5.5) && $BuiltinCreateAsyncTaskInGroup
let canAdd = _taskGroupAddPendingTask(group: _group, unconditionally: false)
Expand Down