Added locks to prevent race conditions with critter_model.