Changeset 51211 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Nov 19, 2009, 3:32:05 PM (16 years ago)
Author:
[email protected]
Message:

isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests..
https://bugs.webkit.org/show_bug.cgi?id=31693

Reviewed by David Levin.

  • wtf/ThreadingPthreads.cpp:

(WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier.
(WTF::isMainThread): Ditto.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r51199 r51211  
     12009-11-19  Dmitry Titov  <[email protected]>
     2
     3        Reviewed by David Levin.
     4
     5        isMainThread() on Chromium (Mac and Linux) is so slow it timeouts LayoutTests..
     6        https://bugs.webkit.org/show_bug.cgi?id=31693
     7
     8        * wtf/ThreadingPthreads.cpp:
     9        (WTF::initializeThreading): grab and use the pthread_t of the main thread instead of ThreadIdentifier.
     10        (WTF::isMainThread): Ditto.
     11
    1122009-11-19  Laszlo Gombos  <[email protected]>
    213
  • trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r50052 r51211  
    5757
    5858#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM)
    59 static ThreadIdentifier mainThreadIdentifier; // The thread that was the first to call initializeThreading(), which must be the main thread.
     59static pthread_t mainThread; // The thread that was the first to call initializeThreading(), which must be the main thread.
    6060#endif
    6161
     
    7373        initializeRandomNumberGenerator();
    7474#if !PLATFORM(DARWIN) || PLATFORM(CHROMIUM)
    75         mainThreadIdentifier = currentThread();
     75        mainThread = pthread_self();
    7676#endif
    7777        initializeMainThread();
     
    233233    return pthread_main_np();
    234234#else
    235     return currentThread() == mainThreadIdentifier;
     235    return pthread_equal(pthread_self(), mainThread);
    236236#endif
    237237}
Note: See TracChangeset for help on using the changeset viewer.