- a/Source/WTF/ChangeLog +13 lines
Lines 1-3 a/Source/WTF/ChangeLog_sec1
1
2017-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3
        [GLIB] MainThread implementation is not GTK+ specific
4
        https://bugs.webkit.org/show_bug.cgi?id=169736
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        It's implemented in MainThreadGLib.cpp for glib based ports, so ifdefs in MainThread should not be
9
        PLATFORM(GTK) but USE(GLIB).
10
11
        * wtf/MainThread.cpp:
12
        * wtf/MainThread.h:
13
1
2017-03-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
14
2017-03-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2
15
3
        [CMake][JSCOnly] Fix build with GLib event loop
16
        [CMake][JSCOnly] Fix build with GLib event loop
- a/Source/WTF/wtf/MainThread.cpp -5 / +5 lines
Lines 41-47 a/Source/WTF/wtf/MainThread.cpp_sec1
41
namespace WTF {
41
namespace WTF {
42
42
43
static bool callbacksPaused; // This global variable is only accessed from main thread.
43
static bool callbacksPaused; // This global variable is only accessed from main thread.
44
#if !OS(DARWIN) && !PLATFORM(GTK)
44
#if !OS(DARWIN) && !USE(GLIB)
45
static ThreadIdentifier mainThreadIdentifier;
45
static ThreadIdentifier mainThreadIdentifier;
46
#endif
46
#endif
47
47
Lines 53-59 static Deque<Function<void ()>>& functionQueue() a/Source/WTF/wtf/MainThread.cpp_sec2
53
    return functionQueue;
53
    return functionQueue;
54
}
54
}
55
55
56
#if OS(DARWIN) || PLATFORM(GTK)
56
#if OS(DARWIN) || USE(GLIB)
57
static pthread_once_t initializeMainThreadKeyOnce = PTHREAD_ONCE_INIT;
57
static pthread_once_t initializeMainThreadKeyOnce = PTHREAD_ONCE_INIT;
58
58
59
static void initializeMainThreadOnce()
59
static void initializeMainThreadOnce()
Lines 68-74 void initializeMainThread() a/Source/WTF/wtf/MainThread.cpp_sec3
68
    pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadOnce);
68
    pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadOnce);
69
}
69
}
70
70
71
#if !USE(WEB_THREAD) && !PLATFORM(GTK)
71
#if !USE(WEB_THREAD) && !USE(GLIB)
72
static void initializeMainThreadToProcessMainThreadOnce()
72
static void initializeMainThreadToProcessMainThreadOnce()
73
{
73
{
74
    initializeThreading();
74
    initializeThreading();
Lines 80-86 void initializeMainThreadToProcessMainThread() a/Source/WTF/wtf/MainThread.cpp_sec4
80
{
80
{
81
    pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadToProcessMainThreadOnce);
81
    pthread_once(&initializeMainThreadKeyOnce, initializeMainThreadToProcessMainThreadOnce);
82
}
82
}
83
#elif !PLATFORM(GTK)
83
#elif !USE(GLIB)
84
static pthread_once_t initializeWebThreadKeyOnce = PTHREAD_ONCE_INIT;
84
static pthread_once_t initializeWebThreadKeyOnce = PTHREAD_ONCE_INIT;
85
85
86
static void initializeWebThreadOnce()
86
static void initializeWebThreadOnce()
Lines 178-184 void setMainThreadCallbacksPaused(bool paused) a/Source/WTF/wtf/MainThread.cpp_sec5
178
        scheduleDispatchFunctionsOnMainThread();
178
        scheduleDispatchFunctionsOnMainThread();
179
}
179
}
180
180
181
#if !OS(DARWIN) && !USE(GLIB_EVENT_LOOP)
181
#if !OS(DARWIN) && !USE(GLIB)
182
bool isMainThread()
182
bool isMainThread()
183
{
183
{
184
    return currentThread() == mainThreadIdentifier;
184
    return currentThread() == mainThreadIdentifier;
- a/Source/WTF/wtf/MainThread.h -1 / +1 lines
Lines 86-92 void initializeMainThreadPlatform(); a/Source/WTF/wtf/MainThread.h_sec1
86
void scheduleDispatchFunctionsOnMainThread();
86
void scheduleDispatchFunctionsOnMainThread();
87
void dispatchFunctionsFromMainThread();
87
void dispatchFunctionsFromMainThread();
88
88
89
#if OS(DARWIN) && !PLATFORM(GTK)
89
#if OS(DARWIN) && !USE(GLIB)
90
#if !USE(WEB_THREAD)
90
#if !USE(WEB_THREAD)
91
// This version of initializeMainThread sets up the main thread as corresponding
91
// This version of initializeMainThread sets up the main thread as corresponding
92
// to the process's main thread, and not necessarily the thread that calls this
92
// to the process's main thread, and not necessarily the thread that calls this

Return to Bug 169736