Changeset 50052 in webkit for trunk/JavaScriptCore/wtf


Ignore:
Timestamp:
Oct 26, 2009, 3:46:55 AM (16 years ago)
Author:
[email protected]
Message:

2009-10-26 Steve Block <[email protected]>

Reviewed by Darin Adler.

Adds ability to disable ReadWriteLock on platforms (eg Android) that use pthreads but do not support pthread_rwlock.
https://bugs.webkit.org/show_bug.cgi?id=30713

  • wtf/Platform.h: Modified. Defines HAVE_PTHREAD_RWLOCK for all platforms currently using pthreads.
  • wtf/Threading.h: Modified. Use pthread_rwlock_t only when HAVE_PTHREAD_RWLOCK is defined.
  • wtf/ThreadingPthreads.cpp: Modified. Build ReadWriteLock methods only when HAVE_PTHREAD_RWLOCK is defined.
Location:
trunk/JavaScriptCore/wtf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Platform.h

    r49688 r50052  
    467467#define WTF_PLATFORM_CF 1
    468468#define WTF_USE_PTHREADS 1
     469#define HAVE_PTHREAD_RWLOCK 1
    469470#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && defined(__x86_64__)
    470471#define WTF_USE_PLUGIN_HOST_PROCESS 1
     
    483484#define WTF_PLATFORM_CF 1
    484485#define WTF_USE_PTHREADS 1
     486#define HAVE_PTHREAD_RWLOCK 1
    485487#endif
    486488
     
    499501#define WTF_PLATFORM_CF 1
    500502#define WTF_USE_PTHREADS 1
     503#define HAVE_PTHREAD_RWLOCK 1
    501504#endif
    502505
     
    512515#if HAVE(PTHREAD_H)
    513516#define WTF_USE_PTHREADS 1
     517#define HAVE_PTHREAD_RWLOCK 1
    514518#endif
    515519#endif
     
    519523#define WTF_USE_CURL 1
    520524#define WTF_USE_PTHREADS 1
     525#define HAVE_PTHREAD_RWLOCK 1
    521526#define USE_SYSTEM_MALLOC 1
    522527#define ENABLE_NETSCAPE_PLUGIN_API 0
  • trunk/JavaScriptCore/wtf/Threading.h

    r48300 r50052  
    129129#if USE(PTHREADS)
    130130typedef pthread_mutex_t PlatformMutex;
     131#if HAVE(PTHREAD_RWLOCK)
    131132typedef pthread_rwlock_t PlatformReadWriteLock;
     133#else
     134typedef void* PlatformReadWriteLock;
     135#endif
    132136typedef pthread_cond_t PlatformCondition;
    133137#elif PLATFORM(GTK)
  • trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r49977 r50052  
    272272}
    273273
    274 
     274#if HAVE(PTHREAD_RWLOCK)
    275275ReadWriteLock::ReadWriteLock()
    276276{
     
    326326    ASSERT_UNUSED(result, !result);
    327327}
     328#endif  // HAVE(PTHREAD_RWLOCK)
    328329
    329330ThreadCondition::ThreadCondition()
Note: See TracChangeset for help on using the changeset viewer.