Changeset 96237 in webkit


Ignore:
Timestamp:
Sep 28, 2011 10:56:10 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Fix webkit2 unit tests in debug builds
https://bugs.webkit.org/show_bug.cgi?id=69006

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2011-09-28
Reviewed by Martin Robinson.

We are currently using the WorQueue name as thread name which in
this moment can be com.apple.WebKit.ProcessLauncher or
com.apple.CoreIPC.ReceiveQueue. Both names are longer than 31
characters which is the limit of Visual Studio for thread
names. When log is enabled createThread() will assert instead of
truncate the name, so we need to make sure we don't use a name
longer than 31 characters.

  • Platform/gtk/WorkQueueGtk.cpp:

(WorkQueue::platformInitialize):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r96226 r96237  
     12011-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Fix webkit2 unit tests in debug builds
     4        https://bugs.webkit.org/show_bug.cgi?id=69006
     5
     6        Reviewed by Martin Robinson.
     7
     8        We are currently using the WorQueue name as thread name which in
     9        this moment can be com.apple.WebKit.ProcessLauncher or
     10        com.apple.CoreIPC.ReceiveQueue. Both names are longer than 31
     11        characters which is the limit of Visual Studio for thread
     12        names. When log is enabled createThread() will assert instead of
     13        truncate the name, so we need to make sure we don't use a name
     14        longer than 31 characters.
     15
     16        * Platform/gtk/WorkQueueGtk.cpp:
     17        (WorkQueue::platformInitialize):
     18
    1192011-09-28  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp

    r95901 r96237  
    100100
    101101// WorkQueue
     102static const size_t kVisualStudioThreadNameLimit = 31;
     103
    102104void WorkQueue::platformInitialize(const char* name)
    103105{
     
    106108    m_eventLoop = g_main_loop_new(m_eventContext, FALSE);
    107109    ASSERT(m_eventLoop);
    108     m_workQueueThread = createThread(reinterpret_cast<WTF::ThreadFunction>(&WorkQueue::startWorkQueueThread), this, name);
     110
     111    // This name can be com.apple.WebKit.ProcessLauncher or com.apple.CoreIPC.ReceiveQueue.
     112    // We are using those names for the thread name, but both are longer than 31 characters,
     113    // which is the limit of Visual Studio for thread names.
     114    // When log is enabled createThread() will assert instead of truncate the name, so we need
     115    // to make sure we don't use a name longer than 31 characters.
     116    const char* threadName = g_strrstr(name, ".");
     117    if (threadName)
     118        threadName++;
     119    else
     120        threadName = name;
     121    if (strlen(threadName) > kVisualStudioThreadNameLimit)
     122        threadName += strlen(threadName) - kVisualStudioThreadNameLimit;
     123
     124    m_workQueueThread = createThread(reinterpret_cast<WTF::ThreadFunction>(&WorkQueue::startWorkQueueThread), this, threadName);
    109125}
    110126
Note: See TracChangeset for help on using the changeset viewer.