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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.