Skip to content

Commit ca64e89

Browse files
committed
#function
1 parent ea36d7a commit ca64e89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

FlyingSocks/Sources/IdentifiableContinuation.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@
4545
@_spi(Private)
4646
public func withIdentifiableContinuation<T>(
4747
isolation: isolated some Actor,
48+
function: String = #function,
4849
body: (IdentifiableContinuation<T, Never>) -> Void,
4950
onCancel handler: @Sendable (IdentifiableContinuation<T, Never>.ID) -> Void
5051
) async -> T {
5152
let id = IdentifiableContinuation<T, Never>.ID()
5253
let state = AllocatedLock(initialState: (isStarted: false, isCancelled: false))
5354
return await withTaskCancellationHandler {
54-
await withCheckedContinuation {
55+
await withCheckedContinuation(function: function) {
5556
let continuation = IdentifiableContinuation(id: id, continuation: $0)
5657
body(continuation)
5758
let sendCancel = state.withLock {
@@ -90,13 +91,14 @@ public func withIdentifiableContinuation<T>(
9091
@_spi(Private)
9192
public func withIdentifiableThrowingContinuation<T>(
9293
isolation: isolated some Actor,
94+
function: String = #function,
9395
body: (IdentifiableContinuation<T, any Error>) -> Void,
9496
onCancel handler: @Sendable (IdentifiableContinuation<T, any Error>.ID) -> Void
9597
) async throws -> T {
9698
let id = IdentifiableContinuation<T, any Error>.ID()
9799
let state = AllocatedLock(initialState: (isStarted: false, isCancelled: false))
98100
return try await withTaskCancellationHandler {
99-
try await withCheckedThrowingContinuation {
101+
try await withCheckedThrowingContinuation(function: function) {
100102
let continuation = IdentifiableContinuation(id: id, continuation: $0)
101103
body(continuation)
102104
let sendCancel = state.withLock {

0 commit comments

Comments
 (0)