]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/qt/MainThreadQt.cpp
JavaScriptCore-621.1.tar.gz
[apple/javascriptcore.git] / wtf / qt / MainThreadQt.cpp
index 7b2d0f25a83afdd00a701e5556fb19db1e1c62dc..98b6a0c4d503fdec11739f045605cb3393e46298 100644 (file)
@@ -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"