aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/debugger
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-04-11 16:27:14 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-24 15:58:25 +0200
commitad615a5a7f2d9060ac043bb7552acebf8fa34550 (patch)
tree4d66bd4930348201fe552a7ca886a78a20968505 /src/qml/debugger
parent2a31da23b459cee39aa26b4384df04daf3d33954 (diff)
Debugger: Add asserts for right usage of threads
Change-Id: I7c377863eb42e693aa4022af33a83098547e0d58 Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
Diffstat (limited to 'src/qml/debugger')
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index 3b18f75370..25cd18bb6b 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -370,6 +370,9 @@ QQmlDebugServer::~QQmlDebugServer()
void QQmlDebugServer::receiveMessage(const QByteArray &message)
{
+ // to be executed in debugger thread
+ Q_ASSERT(QThread::currentThread() == thread());
+
Q_D(QQmlDebugServer);
QDataStream in(message);
@@ -512,6 +515,10 @@ QStringList QQmlDebugServer::serviceNames() const
bool QQmlDebugServer::addService(QQmlDebugService *service)
{
Q_D(QQmlDebugServer);
+
+ // to be executed in GUI thread
+ Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread());
+
{
QWriteLocker(&d->pluginsLock);
if (!service || d->plugins.contains(service->name()))
@@ -532,6 +539,10 @@ bool QQmlDebugServer::addService(QQmlDebugService *service)
bool QQmlDebugServer::removeService(QQmlDebugService *service)
{
Q_D(QQmlDebugServer);
+
+ // to be executed in GUI thread
+ Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread());
+
{
QWriteLocker(&d->pluginsLock);
QQmlDebugService::State newState = QQmlDebugService::NotConnected;
@@ -568,6 +579,9 @@ void QQmlDebugServer::sendMessages(QQmlDebugService *service,
bool QQmlDebugServer::waitForMessage(QQmlDebugService *service)
{
+ // to be executed in GUI thread
+ Q_ASSERT(QThread::currentThread() == QCoreApplication::instance()->thread());
+
Q_D(QQmlDebugServer);
QReadLocker(&d->pluginsLock);