Debugger: Fix race conditions in block mode
authorKai Koehne <kai.koehne@nokia.com>
Tue, 24 Apr 2012 12:39:38 +0000 (14:39 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 25 Apr 2012 12:26:42 +0000 (14:26 +0200)
commit0d284ae2d62707e6c35c8d97ca73e974d35c4167
treed41e0e0c64486a43c45db2c6a8ad3e1a9fba6ec9
parente1583664fd8a9eb66e37bdd2e1476bbf90383a4c
Debugger: Fix race conditions in block mode

Using waitForMessage() in the constructor after registerService() is
_not_ safe: You might get the first message already after the
registerService() and before the waitForMessage() call. Instead,
use QMutex/QWaitCondition to block the initialization. Also make
the use of the block mode explicit, since the service might already
be enabled also for non-blocking modes ...

Change-Id: I387bfe0627c80e2029acff71f86d12cd9ab58de1
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
src/qml/debugger/qdebugmessageservice.cpp
src/qml/debugger/qqmldebugserver.cpp
src/qml/debugger/qqmldebugserver_p.h
src/qml/debugger/qqmldebugservice.cpp
src/qml/debugger/qqmldebugservice_p.h
src/qml/debugger/qqmlprofilerservice.cpp
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/debugger/qv8debugservice.cpp
src/qml/debugger/qv8profilerservice.cpp