summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/qt/MainThreadQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/wtf/qt/MainThreadQt.cpp')
-rw-r--r--JavaScriptCore/wtf/qt/MainThreadQt.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/JavaScriptCore/wtf/qt/MainThreadQt.cpp b/JavaScriptCore/wtf/qt/MainThreadQt.cpp
index 7b2d0f2..98b6a0c 100644
--- a/JavaScriptCore/wtf/qt/MainThreadQt.cpp
+++ b/JavaScriptCore/wtf/qt/MainThreadQt.cpp
@@ -33,7 +33,7 @@
#include <QtCore/QObject>
#include <QtCore/QCoreApplication>
-
+#include <QThread>
namespace WTF {
@@ -67,6 +67,11 @@ void scheduleDispatchFunctionsOnMainThread()
QMetaObject::invokeMethod(webkit_main_thread_invoker(), "dispatch", Qt::QueuedConnection);
}
+bool isMainThread()
+{
+ return QThread::currentThread() == QCoreApplication::instance()->thread();
+}
+
} // namespace WTF
#include "MainThreadQt.moc"