⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239873 in webkit


Ignore:
Timestamp:
Jan 11, 2019, 2:01:07 PM (8 years ago)
Author:
Said Abou-Hallawa
Message:

WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
​https://bugs.webkit.org/show_bug.cgi?id=191350

Reviewed by Brent Fulgham.

The non COCOA version of WorkQueue::concurrentApply() creates a temporary
String for the threadName and passes the raw pointer of this String to
Thread::create(). After freeing this String, Thread::entryPoint() uses
the raw char pointer to internally initialize the thread.

The fix is to use a single literal string for all the threads' names since
they are created for a thread-pool.

  • wtf/WorkQueue.cpp:

(WTF::WorkQueue::concurrentApply):

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r239867 r239873  
     12019-01-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
     4        https://bugs.webkit.org/show_bug.cgi?id=191350
     5
     6        Reviewed by Brent Fulgham.
     7
     8        The non COCOA version of WorkQueue::concurrentApply() creates a temporary
     9        String for the threadName and passes the raw pointer of this String to
     10        Thread::create(). After freeing this String, Thread::entryPoint() uses
     11        the raw char pointer to internally initialize the thread.
     12
     13        The fix is to use a single literal string for all the threads' names since
     14        they are created for a thread-pool.
     15
     16        * wtf/WorkQueue.cpp:
     17        (WTF::WorkQueue::concurrentApply):
     18
    1192019-01-11  Dominik Infuehr  <dinfuehr@igalia.com>
    220
  • trunk/Source/WTF/wtf/WorkQueue.cpp

    r239273 r239873  
    7676            m_workers.reserveInitialCapacity(threadCount);
    7777            for (unsigned i = 0; i < threadCount; ++i) {
    78                 m_workers.append(Thread::create(String::format("ThreadPool Worker %u", i).utf8().data(), [this] {
     78                m_workers.append(Thread::create("ThreadPool Worker", [this] {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    7979                    threadBody();
    8080                }));
Note: See TracChangeset for help on using the changeset viewer.