Reduce critical section even more. Use lock only to update counters.