Fix threading issues

Bug: 25584167
Change-Id: I413ef9e0c86f7cca1f7d085e0071745ca0192853
4 files changed