| 896 | } |
| 897 | |
| 898 | bool BackgroundParser::waitForIdle() const |
| 899 | { |
| 900 | Q_D(const BackgroundParser); |
| 901 | |
| 902 | QList<IndexedString> runningParseJobsUrls; |
| 903 | while (true) { |
| 904 | { |
| 905 | QMutexLocker lock(&d->m_mutex); |
| 906 | if (d->m_parseJobs.isEmpty()) { |
| 907 | qCDebug(LANGUAGE) << "All parse jobs done" << d->m_parseJobs.keys(); |
| 908 | return true; |
| 909 | } |
| 910 | |
| 911 | if (d->m_parseJobs.size() != runningParseJobsUrls.size()) { |
| 912 | runningParseJobsUrls = d->m_parseJobs.keys(); |
| 913 | qCDebug(LANGUAGE) << |
| 914 | "Waiting for background parser to get in idle state... -- the following parse jobs are still running:" |
| 915 | << runningParseJobsUrls; |
| 916 | } |
| 917 | } |
| 918 | |
| 919 | QCoreApplication::processEvents(); |
| 920 | QThread::msleep(100); |
| 921 | } |
| 922 | return false; |
| 923 | } |
| 924 | |
| 925 | DocumentChangeTracker* BackgroundParser::trackerForUrl(const KDevelop::IndexedString& url) const |
| 926 | { |