Merge "TimeStats: fix a racing case" into pi-dev