aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgthreadedrenderloop.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-11-15 15:28:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 21:25:05 +0100
commitf189bb458179630b26a5b93e06eacaa2a138b793 (patch)
tree7fd35be736347c52623d63faa4ac3706c01212b3 /src/quick/scenegraph/qsgthreadedrenderloop.cpp
parente2ca539562fd7fd2eb33c56c5d5d9c0e5196b7af (diff)
Fix lockup in creator.
My previous fix to force expose when the render thread is inactive was not enough. We now lock down access to 'QSGRenderThread::window' so that it will always be set when the thread is in the "exposed" state and 0 when the thread is in the "obscured" state. This introduces another sync point in handleObscurity to protect the writing of window in the render thread. Task-number: QTCREATORBUG-10793 Change-Id: I1e1153189b3a3562705892b42625f88ef6329188 Reviewed-by: Ulf Hermann <ulf.hermann@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 96dfd1c26f..0c46747e53 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -381,10 +381,13 @@ bool QSGRenderThread::event(QEvent *e)
Q_ASSERT(!window || window == static_cast<WMWindowEvent *>(e)->window);
+ mutex.lock();
if (window) {
QSG_RT_DEBUG(" - removed one...");
window = 0;
}
+ waitCondition.wakeOne();
+ mutex.unlock();
return true; }
@@ -799,7 +802,7 @@ void QSGThreadedRenderLoop::show(QQuickWindow *window)
*
* REF: QTCREATORBUG-10699
*/
- if (window->isExposed() && (!w->thread || !w->thread->isRunning()))
+ if (window->isExposed() && (!w->thread || !w->thread->window))
handleExposure(w);
return;
}
@@ -942,8 +945,12 @@ void QSGThreadedRenderLoop::handleExposure(Window *w)
void QSGThreadedRenderLoop::handleObscurity(Window *w)
{
QSG_GUI_DEBUG(w->window, "handleObscurity");
- if (w->thread->isRunning())
+ if (w->thread->isRunning()) {
+ w->thread->mutex.lock();
w->thread->postEvent(new WMWindowEvent(w->window, WM_Obscure));
+ w->thread->waitCondition.wait(&w->thread->mutex);
+ w->thread->mutex.unlock();
+ }
startOrStopAnimationTimer();
}