Changeset 106598 in webkit


Ignore:
Timestamp:
Feb 2, 2012 3:36:40 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Use win32 native threading
https://bugs.webkit.org/show_bug.cgi?id=77676

Patch by Kalev Lember <kalevlember@gmail.com> on 2012-02-02
Reviewed by Martin Robinson.

r97269 switched from glib threading to pthreads, breaking win32 GTK+.
This is a follow up, removing some leftovers in ThreadSpecific.h and
switching win32 to use the native threading in ThreadingWin.cpp.

  • GNUmakefile.list.am: Compile in win32 native threading support
  • wtf/ThreadSpecific.h: Remove GTK+-specific definitions

(ThreadSpecific):
(WTF::::destroy):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r106596 r106598  
     12012-02-02  Kalev Lember  <kalevlember@gmail.com>
     2
     3        [GTK] Use win32 native threading
     4        https://bugs.webkit.org/show_bug.cgi?id=77676
     5
     6        Reviewed by Martin Robinson.
     7
     8        r97269 switched from glib threading to pthreads, breaking win32 GTK+.
     9        This is a follow up, removing some leftovers in ThreadSpecific.h and
     10        switching win32 to use the native threading in ThreadingWin.cpp.
     11
     12        * GNUmakefile.list.am: Compile in win32 native threading support
     13        * wtf/ThreadSpecific.h: Remove GTK+-specific definitions
     14        (ThreadSpecific):
     15        (WTF::::destroy):
     16
    1172012-02-02  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r106197 r106598  
    757757if TARGET_WIN32
    758758javascriptcore_sources += \
    759         Source/JavaScriptCore/wtf/OSAllocatorWin.cpp
     759        Source/JavaScriptCore/wtf/OSAllocatorWin.cpp \
     760        Source/JavaScriptCore/wtf/ThreadFunctionInvocation.h \
     761        Source/JavaScriptCore/wtf/ThreadingWin.cpp \
     762        Source/JavaScriptCore/wtf/ThreadSpecificWin.cpp
    760763else
    761764javascriptcore_sources += \
  • trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h

    r103287 r106598  
    4747#if USE(PTHREADS)
    4848#include <pthread.h>
    49 #elif PLATFORM(GTK)
    50 #include <glib.h>
    5149#elif OS(WINDOWS)
    5250#include <windows.h>
     
    10199#if USE(PTHREADS)
    102100    pthread_key_t m_key;
    103 #elif PLATFORM(GTK)
    104     GStaticPrivate m_key;
    105101#elif OS(WINDOWS)
    106102    int m_index;
     
    129125    ASSERT(!get());
    130126    pthread_setspecific(m_key, new Data(ptr, this));
    131 }
    132 
    133 #elif PLATFORM(GTK)
    134 
    135 template<typename T>
    136 inline ThreadSpecific<T>::ThreadSpecific()
    137 {
    138     g_static_private_init(&m_key);
    139 }
    140 
    141 template<typename T>
    142 inline T* ThreadSpecific<T>::get()
    143 {
    144     Data* data = static_cast<Data*>(g_static_private_get(&m_key));
    145     return data ? data->value : 0;
    146 }
    147 
    148 template<typename T>
    149 inline void ThreadSpecific<T>::set(T* ptr)
    150 {
    151     ASSERT(!get());
    152     Data* data = new Data(ptr, this);
    153     g_static_private_set(&m_key, data, destroy);
    154127}
    155128
     
    219192    // Some pthreads implementations zero out the pointer before calling destroy(), so we temporarily reset it.
    220193    pthread_setspecific(data->owner->m_key, ptr);
    221 #elif PLATFORM(GTK)
    222     // See comment as above
    223     g_static_private_set(&data->owner->m_key, data, 0);
    224194#endif
    225195
     
    229199#if USE(PTHREADS)
    230200    pthread_setspecific(data->owner->m_key, 0);
    231 #elif PLATFORM(GTK)
    232     g_static_private_set(&data->owner->m_key, 0, 0);
    233201#elif OS(WINDOWS)
    234202    TlsSetValue(tlsKeys()[data->owner->m_index], 0);
Note: See TracChangeset for help on using the changeset viewer.