Skip to content

Commit be5ae8c

Browse files
authored
Merge pull request swiftlang#2153 from ahoppen/check-shutdown
Do not schedule any new tasks in `TaskScheduler` if it has been shut down
2 parents a78bc5e + ba1fb5d commit be5ae8c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SemanticIndex/TaskScheduler.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ package actor TaskScheduler<TaskDescription: TaskDescriptionProtocol> {
521521
///
522522
/// This will continue calling itself until the queue is empty.
523523
private func poke() {
524+
if isShutDown {
525+
return
526+
}
524527
pendingTasks.sort(by: { $0.priority > $1.priority })
525528
for task in pendingTasks {
526529
guard

0 commit comments

Comments
 (0)