diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index de8561a21e3b6f85a64c05697c1c8745485457c2..c883ba835ee74faf7b4bc26385e98e77b8542e12 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -3031,7 +3031,7 @@ ProFile *ProFileEvaluator::Private::parsedProFile(const QString &fileName, bool
         if (it != m_option->cache->parsed_files.end()) {
             ent = &*it;
 #ifdef PROPARSER_THREAD_SAFE
-            if (ent->locker) {
+            if (ent->locker && !ent->locker->done) {
                 ++ent->locker->waiters;
                 QThreadPool::globalInstance()->releaseThread();
                 ent->locker->cond.wait(locker.mutex());
@@ -3061,6 +3061,7 @@ ProFile *ProFileEvaluator::Private::parsedProFile(const QString &fileName, bool
 #ifdef PROPARSER_THREAD_SAFE
             locker.relock();
             if (ent->locker->waiters) {
+                ent->locker->done = true;
                 ent->locker->cond.wakeAll();
             } else {
                 delete ent->locker;
diff --git a/src/shared/proparser/profileevaluator.h b/src/shared/proparser/profileevaluator.h
index 746293214e1b4d73bc97135969e58c2943b90a2e..e4acafdd36aa898a2b2cf645569847e61a765165 100644
--- a/src/shared/proparser/profileevaluator.h
+++ b/src/shared/proparser/profileevaluator.h
@@ -123,9 +123,10 @@ private:
         ProFile *pro;
 #ifdef PROPARSER_THREAD_SAFE
         struct Locker {
-            Locker() : waiters(0) {}
+            Locker() : waiters(0), done(false) {}
             QWaitCondition cond;
             int waiters;
+            bool done;
         };
         Locker *locker;
 #endif