Update thread counter to use a Atomic Integer