[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

weinig at apple.com weinig at apple.com
Thu Apr 8 00:33:58 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 2a3264a10b9cf3a6d1aa1e57316f27cfca54a7ee
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 12 06:30:47 2009 +0000

    Allow WTFs concept of the main thread to differ from pthreads when necessary.
    
    Reviewed by Anders Carlsson.
    
    * wtf/ThreadingPthreads.cpp:
    (WTF::initializeThreading):
    (WTF::isMainThread):
    * wtf/mac/MainThreadMac.mm:
    (WTF::initializeMainThreadPlatform):
    (WTF::scheduleDispatchFunctionsOnMainThread):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52046 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index f77f378..8e5b505 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2009-12-11  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Allow WTFs concept of the main thread to differ from pthreads when necessary.
+
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::initializeThreading):
+        (WTF::isMainThread):
+        * wtf/mac/MainThreadMac.mm:
+        (WTF::initializeMainThreadPlatform):
+        (WTF::scheduleDispatchFunctionsOnMainThread):
+
 2009-12-11  Geoffrey Garen  <ggaren at apple.com>
 
         Windows build fix: Export some new symbols.
diff --git a/JavaScriptCore/wtf/ThreadingPthreads.cpp b/JavaScriptCore/wtf/ThreadingPthreads.cpp
index fe7b26a..fbd7164 100644
--- a/JavaScriptCore/wtf/ThreadingPthreads.cpp
+++ b/JavaScriptCore/wtf/ThreadingPthreads.cpp
@@ -55,7 +55,7 @@ typedef HashMap<ThreadIdentifier, pthread_t> ThreadMap;
 
 static Mutex* atomicallyInitializedStaticMutex;
 
-#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM)
+#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD)
 static pthread_t mainThread; // The thread that was the first to call initializeThreading(), which must be the main thread.
 #endif
 
@@ -71,7 +71,7 @@ void initializeThreading()
         atomicallyInitializedStaticMutex = new Mutex;
         threadMapMutex();
         initializeRandomNumberGenerator();
-#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM)
+#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM) || USE(WEB_THREAD)
         mainThread = pthread_self();
 #endif
         initializeMainThread();
@@ -229,7 +229,7 @@ ThreadIdentifier currentThread()
 
 bool isMainThread()
 {
-#if PLATFORM(DARWIN) && !PLATFORM(CHROMIUM)
+#if PLATFORM(DARWIN) && !PLATFORM(CHROMIUM) && !USE(WEB_THREAD)
     return pthread_main_np();
 #else
     return pthread_equal(pthread_self(), mainThread);
diff --git a/JavaScriptCore/wtf/mac/MainThreadMac.mm b/JavaScriptCore/wtf/mac/MainThreadMac.mm
index c79acc1..0ddd5f6 100644
--- a/JavaScriptCore/wtf/mac/MainThreadMac.mm
+++ b/JavaScriptCore/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

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list