Fix race condition in TaskSchedulerTaskTrackerTest.WillPostAndRunLongTaskBeforeShutdown.

Previously, when
TaskSchedulerTaskTrackerTest.WillPostAndRunLongTaskBeforeShutdown ran
with param = SKIP_ON_SHUTDOWN, these events could occur:

  Thread    Action
-----------------------------------------------------------------------
1 Main      Create a skip on shutdown task.
2 Main      TaskTracker::WillPostTask()
3 Main      Start thread to run task (SimpleThread::Start).
4 Main      Start thread to call shutdown (SimpleThread::Start).
5 Shutdown  TaskTracker::Shutdown()
              Returns immediately since the SKIP_ON_SHUTDOWN task
              isn't running yet.
6 Main      Expect shutdown to be blocked on the SKIP_ON_SHUTDOWN task.
              Error!

So far, we've been lucky and #5 never ran before the SKIP_ON_SHUTDOWN
had time to start running. However, making SimpleThread::Start()
non-blocking (https://codereview.chromium.org/2664953004) made
this series of events occur a few times on bots.

BUG=

Review-Url: https://codereview.chromium.org/2798373002
Cr-Commit-Position: refs/heads/master@{#462843}


CrOS-Libchrome-Original-Commit: 539e731c557cbce418d3ac1ea315f6cc9bd0e21f
1 file changed
tree: fd8a881664b7d28707a6f790d16b0c2bbc7f2728
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/