Fix thread safety issue in Distribution copy constructor
digest is guarded by "this", so the constructor needs to
synchronize on the other instance before accessing its digest
object.
@@ -39,7 +39,9 @@ public class Distribution
public Distribution(Distribution distribution)
{
+ synchronized (distribution) {
digest = new QuantileDigest(distribution.digest);
+ }
total = new DecayCounter(distribution.total.getAlpha());
total.merge(distribution.total);
}
