summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/wtf/MainThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/wtf/MainThread.h')
-rw-r--r--JavaScriptCore/wtf/MainThread.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/JavaScriptCore/wtf/MainThread.h b/JavaScriptCore/wtf/MainThread.h
index 01ce804..8c0275b 100644
--- a/JavaScriptCore/wtf/MainThread.h
+++ b/JavaScriptCore/wtf/MainThread.h
@@ -38,6 +38,9 @@ typedef void MainThreadFunction(void*);
void callOnMainThread(MainThreadFunction*, void* context);
+// Blocks the thread until the call finishes on the main thread. Misusing this can easily cause deadlocks.
+void callOnMainThreadAndWait(MainThreadFunction*, void* context);
+
void setMainThreadCallbacksPaused(bool paused);
// Must be called from the main thread (Darwin is an exception to this rule).
@@ -52,6 +55,7 @@ void dispatchFunctionsFromMainThread();
} // namespace WTF
using WTF::callOnMainThread;
+using WTF::callOnMainThreadAndWait;
using WTF::setMainThreadCallbacksPaused;
#endif // MainThread_h