TaskScheduler: Prevent single-threaded CONTINUE_ON_SHUTDOWN from blocking shutdown.

Previously, tasks posted to a shared SingleThreadTaskRunner with the
same traits were scheduled on the same thread. If single-threaded task A
(BACKGROUND, CONTINUE_ON_SHUTDOWN) was scheduled on the thread and
single-threaded task B (BACKGROUND, BLOCK_SHUTDOWN) was posted
afterwards, shutdown could not complete until task A finished and
allowed task B to run on the thread.

This CL fixes the issue by scheduling shared single-threaded tasks
that are CONTINUE_ON_SHUTDOWN/non-CONTINUE_ON_SHUTDOWN on different
threads.

Bug: 829786
Change-Id: Ia0b556971895c2a5799157f8dcf1a1ee6ce650c9
Reviewed-on: https://chromium-review.googlesource.com/1005422
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550216}

CrOS-Libchrome-Original-Commit: a016f19dced52530584d5e8609bca4b1ce9a0453
3 files changed
tree: 0f43c071db9ef86ac135cb5c3748c49620f0c220
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/