Skip to content

Commit a3a61eb

Browse files
committed
Merge branch 'cpp-qcc-compile' of https://github.com/mbaluda/codeql-coding-standards into cpp-qcc-compile
2 parents 823df9e + 01ae8db commit a3a61eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/matrix_testing/CreateMatrixTestReport.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
299299

300300
foreach($testDirectory in $testDirs){
301301

302+
Write-Host "Acquiring lock for $testDirectory"
303+
$Mutex = New-Object -TypeName System.Threading.Mutex -ArgumentList $false, ("__Matrix_" + $testDirectory.Replace([IO.Path]::DirectorySeparatorChar,"_"));
304+
$Mutex.WaitOne() | Out-Null;
305+
Write-Host "Locked $testDirectory"
306+
302307
# for the report
303308
$row = @{
304309
"SUITE" = $CurrentSuiteName;
@@ -412,6 +417,8 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
412417
# output current row state
413418
$row
414419

420+
# release any held mutexes
421+
$Mutex.ReleaseMutex();
415422

416423
###########################################################
417424
###########################################################
@@ -423,6 +430,8 @@ $jobRows = $queriesToCheck | ForEach-Object -ThrottleLimit $NumThreads -Parallel
423430
}
424431
}
425432
# go to next row
433+
434+
426435
}
427436

428437
# combine the outputs

0 commit comments

Comments
 (0)