Skip to content

Commit dd49f80

Browse files
authored
fix data race in build-complete handler (#3352)
motivation: fix data race changes: guard access to progressAnimation with the queue
1 parent 4258f94 commit dd49f80

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Sources/Build/BuildOperationBuildSystemDelegateHandler.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,13 +609,15 @@ final class BuildOperationBuildSystemDelegateHandler: LLBuildBuildSystemDelegate
609609
}
610610

611611
func buildComplete(success: Bool) {
612-
if success {
613-
self.progressAnimation.update(
614-
step: taskTracker.finishedCount,
615-
total: taskTracker.totalCount,
616-
text: "Build complete!")
612+
queue.async {
613+
if success {
614+
self.progressAnimation.update(
615+
step: self.taskTracker.finishedCount,
616+
total: self.taskTracker.totalCount,
617+
text: "Build complete!")
618+
}
619+
self.progressAnimation.complete(success: success)
617620
}
618-
self.progressAnimation.complete(success: success)
619621
}
620622

621623
// MARK: Private

0 commit comments

Comments
 (0)