Merge "Improve the thread flip."