Changeset 24693 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jul 27, 2007, 1:29:44 AM (18 years ago)
Author:
hausmann
Message:

Don't use pthread.h unless thread support is enabled.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r24692 r24693  
     12007-07-27  Simon Hausmann  <[email protected]>
     2
     3        Done with and reviewed by Lars and Zack.
     4
     5        Don't use pthread.h unless thread support is enabled.
     6
     7        * kjs/collector.cpp:
     8        (KJS::Collector::registerAsMainThread):
     9        (KJS::onMainThread):
     10
    1112007-07-27  Simon Hausmann  <[email protected]>
    212
  • trunk/JavaScriptCore/kjs/collector.cpp

    r24633 r24693  
    3434#include <algorithm>
    3535
     36#if USE(MULTIPLE_THREADS)
    3637#include <pthread.h>
     38#endif
    3739
    3840#if PLATFORM(DARWIN)
     
    293295}
    294296
     297#if USE(MULTIPLE_THREADS)
    295298static pthread_t mainThread;
     299#endif
    296300
    297301void Collector::registerAsMainThread()
    298302{
     303#if USE(MULTIPLE_THREADS)
    299304    mainThread = pthread_self();
     305#endif
    300306}
    301307
    302308static inline bool onMainThread()
    303309{
     310#if USE(MULTIPLE_THREADS)
    304311#if PLATFORM(DARWIN)
    305312    return pthread_main_np();
    306313#else
    307314    return !!pthread_equal(pthread_self(), mainThread);
     315#endif
     316#else
     317    return true;
    308318#endif
    309319}
Note: See TracChangeset for help on using the changeset viewer.