Review Request 118617: Add a BackgroundParser::isIdle method that returns whether there is no job queued or running

Denis Steckelmacher steckdenis at yahoo.fr
Mon Jun 9 09:59:35 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118617/
-----------------------------------------------------------

(Updated June 9, 2014, 9:59 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDevelop.


Repository: kdevplatform


Description
-------

BackgroundParser::queuedCount() returns the number of documents that are queued in BackgroundParser. The problem is that this method can return zero when there is no queued document in BackgroundParser, but some of them are still queued or running in ThreadWeaver::Weaver.

The method added by this patch returns true only when the document queue is completely empty and ThreadWeaver::Weaver is idle (no job queued, no job running). When this method returns true, the user can be assured that nothing can happen in a background thread.


Diffs
-----

  language/backgroundparser/backgroundparser.h d96d67b 
  language/backgroundparser/backgroundparser.cpp dec1be7 

Diff: https://git.reviewboard.kde.org/r/118617/diff/


Testing
-------

This new method is used by the QML/JS plugin to wait for all the parsing jobs to be finished before trying to use and free DUContexts. The unit tests of the QMLJS plugin all pass with this patch applied. All the unit tests of KDevPlatform also pass with this patch applied.


Thanks,

Denis Steckelmacher

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140609/5ab71342/attachment.html>


More information about the KDevelop-devel mailing list