Description[Sync] Do not deadlock when joining sync thread with a pending HistoryModelWorker task.
Currently, this scenario results in a deadlock:
Thread Action
Sync HistoryModelWorker::DoWorkAndWaitUntilDone
Posts to the UI thread and waits.
UI HistoryModelWorker::RequestStop
UI Join the sync thread.
Deadlock because the sync thread is waiting
for a task to run on the UI thread.
With this CL, RequestStop() unblocks DoWorkAndWaitUntilDone()
on the sync thread when it is waiting for a UI task.
This change is similar to https://codereview.chromium.org/2505913003
BUG=663600
Patch Set 1 #Patch Set 2 : self-review #
Total comments: 12
Patch Set 3 : CR #Patch Set 4 : self-review #Patch Set 5 : self-review #Patch Set 6 : self-review #Patch Set 7 : self-review #
Total comments: 8
Patch Set 8 : CR #
Total comments: 2
Patch Set 9 : fix comment #
Messages
Total messages: 19 (10 generated)
|