• David Faure's avatar
    Fix ItemRetriever in case of concurrent requests for the same item(s) · d42f9470
    David Faure authored
    - ItemRetrievalManager must emit requestFinished() for those other requests,
    otherwise the list of pending requests in ItemRetriever is never emptied
    - ItemRetriever must not assume that a signal being emitted by
    ItemRetrievalManager is necessarily about the request it's waiting for, it
    could be for another one. So it must first check in its list of pending
    requests to determine whether it should react or not.
    With multithreaded unittest, checked for races with clang+tsan.
    (There is one race, the connect to ItemRetrievalRequest vs the emit
    in other threads, we should lock mLock before connect...)
    Test Plan: new unittest
    Reviewers: dvratil
    Reviewed By: dvratil
    Subscribers: #kde_pim
    Tags: #kde_pim
    Differential Revision: https://phabricator.kde.org/D4618
itemretriever.cpp 13.5 KB