Merge pull request #1544 from broadinstitute/rhl_thread_safety_1543

Synchronize modification/access to practicalAlleleCountForPloidy
This commit is contained in:
Ron Levine 2017-01-07 10:00:18 -05:00 committed by GitHub
commit c5df90b598
1 changed files with 1 additions and 1 deletions

View File

@ -353,7 +353,7 @@ public class HaplotypeCallerGenotypingEngine extends GenotypingEngine<AssemblyBa
* @param ploidy ploidy of the sample
* @param alleleMapper original allele to haplotype map
*/
private VariantContext removeAltAllelesIfTooManyGenotypes(final int ploidy, final Map<Allele, List<Haplotype>> alleleMapper, final VariantContext mergedVC) {
private synchronized VariantContext removeAltAllelesIfTooManyGenotypes(final int ploidy, final Map<Allele, List<Haplotype>> alleleMapper, final VariantContext mergedVC) {
final int originalAlleleCount = alleleMapper.size();
practicalAlleleCountForPloidy.putIfAbsent(ploidy, GenotypeLikelihoodCalculators.computeMaxAcceptableAlleleCount(ploidy, maxGenotypeCountToEnumerate));