Merge "Improve the thread flip."
am: f606c3a687

Change-Id: I93770b75a2d9e3ae3f3d53f37985d031425efe98