[webkit-help] Are RunLoop::Timer::start() and stop() expected to be thread safe?

Konstantin Tokarev annulen at yandex.ru
Fri Apr 22 09:29:41 PDT 2016


Hello,

Are RunLoop::Timer::start() and stop() expected to be thread safe?

For example, VideoRenderRequestScheduler[1] uses Timer::startOneShot() with zero interval as a mean to run task in other thread, which can be cancelled. Timer is initialized with RunLoop::main(), and startOneShot(0) is called from differenet thread.

This approach works at least for GTK and EFL ports, however I'm wondering if this is a correct way to do in principle, or there is better approach which does not involve starting Timer from different thread.

[1] WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp

-- 
Regards,
Konstantin


More information about the webkit-help mailing list