Lock when reading the time and update number in snapshots