HomePhabricator

Make _flush aware of _putthread ongoing tasks

Authored by Mpaa on Sep 1 2017, 9:10 PM.

Description

Make _flush aware of _putthread ongoing tasks

Make sure _flush() is aware if _putthread() is idle or working on a
task.
Relying on page_put_queue.qsize() > 0 only, as a condition to keep the while
loop alive is not safe as the last item in the queue can be fetched by
async_manager() before page_put_queue.qsize() is checked and then found empty.
In this case _flush() returns before all pending requests are served.

A new Queue is introduced as a form of synchronisation between
MainThread in _flush() and asyc_manager(), signalling when async_manager
is actually working and not idle waiting for a request.

Bug: T147178
Change-Id: I184b445c43aa44cb000bfacc1cad18d2de265c48

Details

Committed
MpaaOct 16 2019, 8:45 PM
Parents
rPWBC26deab88936c: Update git submodules
Branches
Unknown
Tags
Unknown
ChangeId
I184b445c43aa44cb000bfacc1cad18d2de265c48