Skip to content

Commit 4729e09

Browse files
committed
Block on emitting parseable-output messages in executeJob.
`executeJob` itself runs in a concurrent context. Adding further asynchrnony in emitting parseable-output here isn't worth the trouble it can cause because the performance implications of waiting for these messages to be emitted are likely negligible. Blocking on calls to `jobStarted` and `jobFinished` defines away various possibilities for trouble, for example - the executor concluding its workload and returning before all parseable-output messages have been emitted, potentially confusing the build system in the process. Resolves rdar://74058113
1 parent 56cba83 commit 4729e09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftDriverExecution/MultiJobExecutor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ class ExecuteJobRule: LLBuildRule {
523523
}
524524

525525
// Inform the delegate.
526-
context.delegateQueue.async {
526+
context.delegateQueue.sync {
527527
context.executorDelegate.jobStarted(job: job, arguments: arguments, pid: pid)
528528
knownPId.insert(pid)
529529
}
@@ -549,7 +549,7 @@ class ExecuteJobRule: LLBuildRule {
549549
}
550550

551551
// Inform the delegate about job finishing.
552-
context.delegateQueue.async {
552+
context.delegateQueue.sync {
553553
context.executorDelegate.jobFinished(job: job, result: result, pid: pid)
554554
}
555555
context.cancelBuildIfNeeded(result)
@@ -564,7 +564,7 @@ class ExecuteJobRule: LLBuildRule {
564564
// Only inform finished job if the job has been started, otherwise the build
565565
// system may complain about malformed output
566566
if (knownPId.contains(pid)) {
567-
context.delegateQueue.async {
567+
context.delegateQueue.sync {
568568
let result = ProcessResult(
569569
arguments: [],
570570
environment: env,

0 commit comments

Comments
 (0)