added the thread migration counter.
corrected merge conflicts