Changeset 53682 in webkit


Ignore:
Timestamp:
Jan 21, 2010 11:36:29 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-21 Kwang Yul Seo <skyul@company100.net>

Reviewed by Alexey Proskuryakov.

Add ThreadSpecific for ENABLE(SINGLE_THREADED)
https://bugs.webkit.org/show_bug.cgi?id=33878

Implement ThreadSpecific with a simple getter/setter
when ENABLE(SINGLE_THREADED) is true.

Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236,
an implementation of ThreadSpecific must be available to build WebKit.
This causes a build failure for platforms without a proper
ThreadSpecific implementation.

  • wtf/ThreadSpecific.h: (WTF::::ThreadSpecific): (WTF::::~ThreadSpecific): (WTF::::get): (WTF::::set): (WTF::::destroy):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r53677 r53682  
     12010-01-21  Kwang Yul Seo  <skyul@company100.net>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Add ThreadSpecific for ENABLE(SINGLE_THREADED)
     6        https://bugs.webkit.org/show_bug.cgi?id=33878
     7
     8        Implement ThreadSpecific with a simple getter/setter
     9        when ENABLE(SINGLE_THREADED) is true.
     10
     11        Due to the change in https://bugs.webkit.org/show_bug.cgi?id=33236,
     12        an implementation of ThreadSpecific must be available to build WebKit.
     13        This causes a build failure for platforms without a proper
     14        ThreadSpecific implementation.
     15
     16        * wtf/ThreadSpecific.h:
     17        (WTF::::ThreadSpecific):
     18        (WTF::::~ThreadSpecific):
     19        (WTF::::get):
     20        (WTF::::set):
     21        (WTF::::destroy):
     22
    1232010-01-21  Kwang Yul Seo  <skyul@company100.net>
    224
  • trunk/JavaScriptCore/wtf/ThreadSpecific.h

    r52791 r53682  
    9292#endif
    9393
     94#if ENABLE(SINGLE_THREADED)
     95    T* m_value;
     96#else
    9497#if USE(PTHREADS)
    9598    pthread_key_t m_key;
     
    99102    int m_index;
    100103#endif
     104#endif
    101105};
    102106
     107#if ENABLE(SINGLE_THREADED)
     108template<typename T>
     109inline ThreadSpecific<T>::ThreadSpecific()
     110    : m_value(0)
     111{
     112}
     113
     114template<typename T>
     115inline ThreadSpecific<T>::~ThreadSpecific()
     116{
     117}
     118
     119template<typename T>
     120inline T* ThreadSpecific<T>::get()
     121{
     122    return m_value;
     123}
     124
     125template<typename T>
     126inline void ThreadSpecific<T>::set(T* ptr)
     127{
     128    ASSERT(!get());
     129    m_value = ptr;
     130}
     131#else
    103132#if USE(PTHREADS)
    104133template<typename T>
     
    208237#error ThreadSpecific is not implemented for this platform.
    209238#endif
     239#endif
    210240
    211241template<typename T>
    212242inline void ThreadSpecific<T>::destroy(void* ptr)
    213243{
     244#if !ENABLE(SINGLE_THREADED)
    214245    Data* data = static_cast<Data*>(ptr);
    215246
     
    239270#if !PLATFORM(QT)
    240271    delete data;
     272#endif
    241273#endif
    242274}
Note: See TracChangeset for help on using the changeset viewer.