X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9dae56ea45a0f5f8136a5c93d6f3a7f99399ca73..fb8617cde5834786bd4e4afd579883e4acf5666e:/wtf/MainThread.h diff --git a/wtf/MainThread.h b/wtf/MainThread.h index 953b986..8c0275b 100644 --- a/wtf/MainThread.h +++ b/wtf/MainThread.h @@ -37,6 +37,8 @@ class Mutex; 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); @@ -45,13 +47,15 @@ void setMainThreadCallbacksPaused(bool paused); void initializeMainThread(); // These functions are internal to the callOnMainThread implementation. -void dispatchFunctionsFromMainThread(); +void initializeMainThreadPlatform(); void scheduleDispatchFunctionsOnMainThread(); Mutex& mainThreadFunctionQueueMutex(); +void dispatchFunctionsFromMainThread(); } // namespace WTF using WTF::callOnMainThread; +using WTF::callOnMainThreadAndWait; using WTF::setMainThreadCallbacksPaused; #endif // MainThread_h