зеркало из https://github.com/mozilla/gecko-dev.git
Bug 969709 - Fix race in ThreadPool::abortJob; fixes intermittent oranges on a CLOSED TREE. (r=nmatsakis)
This commit is contained in:
Родитель
209b2e8849
Коммит
8ab0b01fd6
|
@ -589,4 +589,14 @@ ThreadPool::abortJob()
|
|||
mainWorker_->abort();
|
||||
for (uint32_t workerId = 0; workerId < numWorkers(); workerId++)
|
||||
workers_[workerId]->abort();
|
||||
|
||||
// Spin until pendingSlices_ reaches 0.
|
||||
//
|
||||
// The reason for this is that while calling abort() clears all workers'
|
||||
// bounds, the pendingSlices_ cache might still be > 0 due to
|
||||
// still-executing calls to popSliceBack or popSliceFront in other
|
||||
// threads. When those finish, we will be sure that !hasWork(), which is
|
||||
// important to ensure that an aborted worker does not start again due to
|
||||
// the thread pool having more work.
|
||||
while (hasWork());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче