USE(WEB_THREAD): More explicit WebThread initialization
[WebKit-https.git] / Source / WTF / wtf / MainThread.cpp
index e77b15f873472b0e8f7a047a6482b441ea1386af..d16f95a57227ce9b52dec6392bd1b9dfe10b06f2 100644 (file)
@@ -127,6 +127,18 @@ void initializeMainThreadToProcessMainThread()
 {
     pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadToProcessMainThreadOnce);
 }
+#else
+static pthread_once_t initializeWebThreadKeyOnce = PTHREAD_ONCE_INIT;
+
+static void initializeWebThreadOnce()
+{
+    initializeWebThreadPlatform();
+}
+
+void initializeWebThread()
+{
+    pthread_once(&initializeWebThreadKeyOnce, initializeWebThreadOnce);
+}
 #endif // !USE(WEB_THREAD)
 
 #endif