Data race fix in DistMat