]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wtf/mac/MainThreadMac.mm
JavaScriptCore-576.tar.gz
[apple/javascriptcore.git] / wtf / mac / MainThreadMac.mm
index c79acc16f817362b0ae3b055b24dfa6119d18242..0ddd5f64ea28a0726792c9ebabf8385c0f8250b5 100644 (file)
 namespace WTF {
 
 static WTFMainThreadCaller* staticMainThreadCaller = nil;
+#if USE(WEB_THREAD)
+static NSThread* webThread = nil;
+#endif
 
 void initializeMainThreadPlatform()
 {
     ASSERT(!staticMainThreadCaller);
     staticMainThreadCaller = [[WTFMainThreadCaller alloc] init];
+
+#if USE(WEB_THREAD)
+    webThread = [[NSThread currentThread] retain];
+#endif
 }
 
 void scheduleDispatchFunctionsOnMainThread()
 {
     ASSERT(staticMainThreadCaller);
+#if USE(WEB_THREAD)
+    [staticMainThreadCaller performSelector:@selector(call) onThread:webThread withObject:nil waitUntilDone:NO];
+#else
     [staticMainThreadCaller performSelectorOnMainThread:@selector(call) withObject:nil waitUntilDone:NO];
+#endif
 }
 
 } // namespace WTF