[Webkit-unassigned] [Bug 137513] [GLib] Add a simple GMainLoopSource variant

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 8 01:38:02 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=137513





--- Comment #2 from Carlos Garcia Campos <cgarcia at igalia.com>  2014-10-08 01:37:58 PST ---
(From update of attachment 239460)
View in context: https://bugs.webkit.org/attachment.cgi?id=239460&action=review

This is independent of the split in any case, we would still need cancellables and mutexes for thread safe sources, and we don't need that for sources used by the same thread. Instead of creating a new class, we could create a new GSource that is created on demand when scheduled is called for a non repeating source with no destroy func, for example.

> Source/WTF/wtf/gobject/GMainLoopSource.cpp:475
> +    g_source_set_ready_time(m_source.get(), g_get_monotonic_time() + delay.count() * 1000);

My main concern of this approach is that it works because the current glib implementation allows it, but it hasn't been thought to be used this way, I think

> Source/WTF/wtf/gobject/GMainLoopSource.cpp:502
> +    [](GSource*, GSourceFunc callback, gpointer userData) -> gboolean
> +    {
> +        return callback(userData);
> +    },

This will not work for repeating sources that will be marked as destroyed if they return Stop. I think you could call set_ready_time here, and return G_SOURCE_CONTINUE unconditionally here as well to make it clear this source will not be destroyed.

> Source/WebCore/platform/gtk/SharedTimerGtk.cpp:36
> +static void (*sharedTimerFiredFunction)() = nullptr;

I don't think you need to initialize global static vars to 0.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list