<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] Use RunLoop::Timer instead of GMainLoopSource in video sink"
   href="https://bugs.webkit.org/show_bug.cgi?id=150807#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GStreamer] Use RunLoop::Timer instead of GMainLoopSource in video sink"
   href="https://bugs.webkit.org/show_bug.cgi?id=150807">bug 150807</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=150807#c7">comment #7</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=264681&amp;action=diff" name="attach_264681" title="Updated patch">attachment 264681</a> <a href="attachment.cgi?id=264681&amp;action=edit" title="Updated patch">[details]</a></span>
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=264681&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=264681&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp:92
&gt; &gt; +        m_timer.stop();
&gt; &gt; +        LockHolder locker(m_sampleMutex);
&gt; 
&gt; I'm still stuck on this. in requestRender() m_timer operation is protected,
&gt; here it's not.</span >

It's not actually the timer what is protected, but the sample, we need to hold the lock for the condition wait. 

<span class="quote">&gt; Regarding previous behavior, timeoutSource was never cancelled after
&gt; scheduling, except when WebKitVideoSinkPrivate was destroyed. This
&gt; technically deviates from that.</span >

That's right, but I think it was not desirable. We always wait until the timer is actually fired. That means that if unlockSampleMutex() was called for whatever reason before the timer is fired, the sample is destroyed and the condition was released, so we don't keep waiting anymore. But the timer will be fired anyway, but will return early because sample is NULL (and unlocked = true). Stopping the timer we just avoid the callback to be called just to return.</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>