<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:zan@falconsigh.net" title="Zan Dobersek <zan@falconsigh.net>"> <span class="fn">Zan Dobersek</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use a persistent main loop source in RunLoop glib implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=150590">bug 150590</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #264130 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use a persistent main loop source in RunLoop glib implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=150590#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [GTK] Use a persistent main loop source in RunLoop glib implementation"
href="https://bugs.webkit.org/show_bug.cgi?id=150590">bug 150590</a>
from <span class="vcard"><a class="email" href="mailto:zan@falconsigh.net" title="Zan Dobersek <zan@falconsigh.net>"> <span class="fn">Zan Dobersek</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=264130&action=diff" name="attach_264130" title="Patch">attachment 264130</a> <a href="attachment.cgi?id=264130&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=264130&action=review">https://bugs.webkit.org/attachment.cgi?id=264130&action=review</a>
<span class="quote">> Source/WTF/wtf/glib/RunLoopGLib.cpp:146
> stop();
> + g_source_destroy(m_source.get());</span >
Is stop() still bringing anything here, given that the source is destroyed afterwards?
<span class="quote">> Source/WTF/wtf/glib/RunLoopGLib.cpp:152
> + gint64 current = g_get_monotonic_time();
> + g_source_set_ready_time(m_source.get(), m_fireInterval.count() ? current + m_fireInterval.count() : current);</span >
I'd advise special-casing the 0-microsecond delay here, which is the most common.
<span class="quote">> gint64 delay = 0;
> if (m_fireInterval.count())
> delay = g_get_monotonic_time() + m_fireInterval.count()
> g_source_set_ready_time(m_source.get(), delay);</span >
That way you avoid querying the monotonic time for most cases, and 0 delay still means 'dispatch ASAP' in GLib.
<span class="quote">> Source/WTF/wtf/glib/RunLoopGLib.cpp:157
> + stop();</span >
Is stop() useful here? The source's ready time is updated afterwards anyway.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>