Do not create parse jobs while the background parser is suspended
ClosedPublic

Authored by mwolff on Nov 19 2017, 5:28 PM.

Details

Summary

Suspending only stopped the timer and suspended the thread weaver
queue. This is not enough: When startTimer is called the next time,
e.g. via ::addDocument, it would still trigger a call of
parseDocumentsInternal and eventually the creation of a parse job.
That one wouldn't be able to start working, as the queue is suspended.
But for clang parse jobs, it would already try to look for the
foreground parse environment (i.e. include paths and such). A future
patch will suspend the background parser while the core is being
initialized, which ensures that we won't create parse jobs with
broken environments at startup.

Diff Detail

Repository
R32 KDevelop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mwolff created this revision.Nov 19 2017, 5:28 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 19 2017, 5:28 PM
brauch added a subscriber: brauch.Nov 19 2017, 5:56 PM

Can it happen that resume() is called before ThreadWeaver has finished suspending, causing it not to resume? Otherwise LGTM

mwolff updated this revision to Diff 22610.Nov 19 2017, 6:42 PM

extend unit test to also check whether resuming directly after suspend works

brauch accepted this revision.Nov 19 2017, 6:44 PM

Nice, thanks.

This revision is now accepted and ready to land.Nov 19 2017, 6:44 PM
This revision was automatically updated to reflect the committed changes.