Fix NullPointerException issue due to threads race

- In current implementation, the CountDownLatch variable
  is initialized improperly between two threads.
  The initialization and use of the CountDownLatch variable
  are in different threads. That will cause
  NullPointerException exception due to threads race.
  To fix it, initializing the CountDownLatch variable
  in one thread before another thread which using
  the CountDownLatch variable is started.

Bug: 400612242
Test: manual
Flag: NONE bugfix
Change-Id: Id3dac00c5edac683d0356c09907ef6efb3a228a8
1 file changed