From fce66a5750ab14ef12f2a3cb37f20d038a8d120f Mon Sep 17 00:00:00 2001 From: Tom White Date: Tue, 4 Sep 2018 10:17:32 +0100 Subject: [PATCH] Add comment explaning synchronization. --- .../walkers/genotyper/GenotypeLikelihoodCalculators.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeLikelihoodCalculators.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeLikelihoodCalculators.java index d8509ed35e2..70efb349091 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeLikelihoodCalculators.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeLikelihoodCalculators.java @@ -270,7 +270,9 @@ public GenotypeLikelihoodCalculator getInstance(final int ploidy, final int alle } /** - * Update of shared tables + * Update of shared tables. Note that this method is synchronized to avoid race conditions in Spark. This is because + * in Spark each region has its own HaplotypeCallerEngine instance (so there can be multiple instances in a single + * JVM), but these share a single (static) instance of this class (via AlleleSubsettingUtils). * * @param requestedMaximumAllele the new requested maximum allele maximum. * @param requestedMaximumPloidy the new requested ploidy maximum.