Do not try to cleanup the DUChain while parse jobs are running.

Authored by mwolff on Feb 20 2016, 11:29 PM.

Description

Do not try to cleanup the DUChain while parse jobs are running.

This can interfer drastically with the ongoing parse jobs. Most
notably, I just encountered a case where a long-running parse job
was ongoing, but all other parse threads where waiting since the
cleanup thread already tried to lock for write, thereby starving
the parse jobs.

I think we should wait with the cleanup until the parse jobs have
finished. To do so, we try to lock for write and give up if this
does not succeed.

Differential Revision: https://phabricator.kde.org/D997

Details