Shouldn't parse jobs be aborted when KDevelop gets closed?

David Nolden david.nolden.kdevelop at art-master.de
Sun Jul 5 22:32:50 UTC 2009


Am Sonntag 05 Juli 2009 23:47:59 schrieb Milian Wolff:
> Hey guys, I just wondered:
>
> Why don't we force-abort any jobs in the background parser when kdevelop
> quits? We explicitly have code like the following in both dtors for PHP /
> Cpp:
>
>
>     ILanguage* lang = language();
>     lang->parseLock()->lockForWrite();
>     m_self = 0; //By locking the parse-mutexes, we make sure that parse-
> and preprocess-jobs get a chance to finish in a good state
>     lang->parseLock()->unlock();
>
> Imo when I quit, the application should abort anything it does and just
> quit...
How do you cleanly abort running code? You would have to pollute that code 
with tons of exit points and additional safety, and you could end up with 
invalid duchain or similar things.

The background parse keeps the count of parse-jobs nearly equal to the count 
of simultaneous parse threads running, so finishing those parse-jobs is not 
much work, unless they also process tons of included headers for example.

If you want to improve something about this, we could add some additional flag 
like "static bool ParseJob::shouldAbort()", which the parse-jobs could check 
at clean exit points(like when trying to parse a new include file), to reduce 
the delay. Actually I think something like that is already there, but I don't 
know if it's working (No time to look into it now, you can take a look at 
cppparsejob.cpp).

Greetings, David





More information about the KDevelop-devel mailing list