From 1f6645539abe63a68c3b51ffd03c054e9685b2a8 Mon Sep 17 00:00:00 2001 From: Ron Levine Date: Wed, 11 Jan 2017 17:58:20 -0500 Subject: [PATCH] Make upstreamDeletionsLoc ThreadLocal --- .../gatk/tools/walkers/genotyper/GenotypingEngine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java index 2635fea66..2d01a9a68 100644 --- a/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java +++ b/protected/gatk-tools-protected/src/main/java/org/broadinstitute/gatk/tools/walkers/genotyper/GenotypingEngine.java @@ -106,7 +106,7 @@ public abstract class GenotypingEngine upstreamDeletionsLoc = new LinkedList<>(); + private final ThreadLocal< List > upstreamDeletionsLoc = ThreadLocal.withInitial(() -> new LinkedList()); protected final AFCalculator newAFCalculator; @@ -411,7 +411,7 @@ public abstract class GenotypingEngine 0) { final GenomeLoc genomeLoc = genomeLocParser.createGenomeLocOnContig(vc.getContig(), vc.getStart(), vc.getStart() + deletionSize); - upstreamDeletionsLoc.add(genomeLoc); + upstreamDeletionsLoc.get().add(genomeLoc); } } @@ -422,7 +422,7 @@ public abstract class GenotypingEngine it = upstreamDeletionsLoc.iterator(); it.hasNext(); ) { + for (Iterator it = upstreamDeletionsLoc.get().iterator(); it.hasNext(); ) { final GenomeLoc loc = it.next(); if (!loc.getContig().equals(vc.getContig())) { // past contig deletion. it.remove();