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

Denis Steckelmacher steckdenis at yahoo.fr
Sun Jun 8 13:35:13 UTC 2014


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

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. The testsuite of kdevplatform has no regression, but seven tests fail with or without this patch:

The following tests FAILED:
         25 - shell-documentcontrollertest (Failed)
         26 - shell-uicontrollertest (Failed)
         27 - shell-buddytest (Failed)
         28 - shell-documentoperationtest (Failed)
         38 - modelsTest (Failed)
         39 - reloadtest (Failed)
         40 - standardoutputview-test (Failed)

They crash in the initialization code. I think that it is a problem in my setup or something like that, because they all pass on build.kde.org.


Thanks,

Denis Steckelmacher

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


More information about the KDevelop-devel mailing list