avoid deadlock in cache() during spec/cache loading

if we end up calling cache() from within the initialization of the base
context, we cannot wait for for the completion of that initialization
before we proceed, obviously.

Change-Id: If30c6f3665fe423e767373a8821c406b2f5e0eca
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Oswald Buddenhagen
2013-08-12 21:12:36 +02:00
parent af8a95d1fc
commit b64b4431c2

View File

@@ -1544,7 +1544,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
break; break;
#ifdef PROEVALUATOR_THREAD_SAFE #ifdef PROEVALUATOR_THREAD_SAFE
QMutexLocker locker(&baseEnv->mutex); QMutexLocker locker(&baseEnv->mutex);
if (baseEnv->inProgress) { if (baseEnv->inProgress && baseEnv->evaluator != this) {
// The env is still in the works, but it may be already past the cache // The env is still in the works, but it may be already past the cache
// loading. So we need to wait for completion and amend it as usual. // loading. So we need to wait for completion and amend it as usual.
QThreadPool::globalInstance()->releaseThread(); QThreadPool::globalInstance()->releaseThread();