X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63:/wtf/mac/MainThreadMac.mm diff --git a/wtf/mac/MainThreadMac.mm b/wtf/mac/MainThreadMac.mm index c79acc1..0ddd5f6 100644 --- a/wtf/mac/MainThreadMac.mm +++ b/wtf/mac/MainThreadMac.mm @@ -49,17 +49,28 @@ 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