Skip to content
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
3 changes: 3 additions & 0 deletions Sources/TaskGate/AsyncGate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public final class AsyncGate {
return try await withTaskPriorityEscalationHandler { () throws(Failure) -> Result in
try await body()
} onPriorityEscalated: { _, newPriority in
// This task was added to prevent self deadlock from happening
// without it, deadlock could happen because `escalatePriority`
// will try to have the lock which is already in use by the same thread
Task {
uncheckedSelf.escalatePriority(to: newPriority)
}
Expand Down