Title: [123344] trunk/Source/WTF
Revision
123344
Author
[email protected]
Date
2012-07-23 08:59:12 -0700 (Mon, 23 Jul 2012)

Log Message

[BlackBerry] Merge createThreadInternal implementations
https://bugs.webkit.org/show_bug.cgi?id=91899

Reviewed by Yong Li.

PR 111675

Remove our implementation since the default thread stack size on QNX is fine.

* wtf/ThreadingPthreads.cpp:
(WTF::createThreadInternal):
(WTF::initializeCurrentThreadInternal): make sure we set the thread name.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (123343 => 123344)


--- trunk/Source/WTF/ChangeLog	2012-07-23 15:50:29 UTC (rev 123343)
+++ trunk/Source/WTF/ChangeLog	2012-07-23 15:59:12 UTC (rev 123344)
@@ -1,3 +1,18 @@
+2012-07-23  Rob Buis  <[email protected]>
+
+        [BlackBerry] Merge createThreadInternal implementations
+        https://bugs.webkit.org/show_bug.cgi?id=91899
+
+        Reviewed by Yong Li.
+
+        PR 111675
+
+        Remove our implementation since the default thread stack size on QNX is fine.
+
+        * wtf/ThreadingPthreads.cpp:
+        (WTF::createThreadInternal):
+        (WTF::initializeCurrentThreadInternal): make sure we set the thread name.
+
 2012-07-23  Patrick Gansterer  <[email protected]>
 
         [WINCE] Define NOMINMAX in the build system instead of Platform.h

Modified: trunk/Source/WTF/wtf/ThreadingPthreads.cpp (123343 => 123344)


--- trunk/Source/WTF/wtf/ThreadingPthreads.cpp	2012-07-23 15:50:29 UTC (rev 123343)
+++ trunk/Source/WTF/wtf/ThreadingPthreads.cpp	2012-07-23 15:59:12 UTC (rev 123344)
@@ -59,11 +59,6 @@
 #include <objc/objc-auto.h>
 #endif
 
-#if PLATFORM(BLACKBERRY)
-#include <BlackBerryPlatformMisc.h>
-#include <BlackBerryPlatformSettings.h>
-#endif
-
 namespace WTF {
 
 typedef HashMap<ThreadIdentifier, pthread_t> ThreadMap;
@@ -164,45 +159,6 @@
     return 0;
 }
 
-#if PLATFORM(BLACKBERRY)
-ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char* threadName)
-{
-    pthread_attr_t attr;
-    if (pthread_attr_init(&attr)) {
-        LOG_ERROR("pthread_attr_init() failed: %d", errno);
-        return 0;
-    }
-
-    void* stackAddr;
-    size_t stackSize;
-    if (pthread_attr_getstack(&attr, &stackAddr, &stackSize))
-        LOG_ERROR("pthread_attr_getstack() failed: %d", errno);
-    else {
-        stackSize = BlackBerry::Platform::Settings::instance()->secondaryThreadStackSize();
-        if (pthread_attr_setstack(&attr, stackAddr, stackSize))
-            LOG_ERROR("pthread_attr_getstack() failed: %d", errno);
-    }
-
-    OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
-    pthread_t threadHandle;
-    if (pthread_create(&threadHandle, &attr, wtfThreadEntryPoint, invocation.get())) {
-        LOG_ERROR("pthread_create() failed: %d", errno);
-        threadHandle = 0;
-    }
-    pthread_setname_np(threadHandle, threadName);
-
-    pthread_attr_destroy(&attr);
-
-    if (!threadHandle)
-        return 0;
-
-    // Balanced by adoptPtr() in wtfThreadEntryPoint.
-    ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr();
-    UNUSED_PARAM(leakedInvocation);
-
-    return establishIdentifierForPthreadHandle(threadHandle);
-}
-#else
 ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*)
 {
     OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data));
@@ -218,12 +174,13 @@
 
     return establishIdentifierForPthreadHandle(threadHandle);
 }
-#endif
 
 void initializeCurrentThreadInternal(const char* threadName)
 {
 #if HAVE(PTHREAD_SETNAME_NP)
     pthread_setname_np(threadName);
+#elif OS(QNX)
+    pthread_setname_np(pthread_self(), threadName);
 #else
     UNUSED_PARAM(threadName);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to