[vlc-devel] commit: atmo filter: disable until it is fixed ( Rémi Denis-Courmont )
Rémi Denis-Courmont
remi at remlab.net
Tue Aug 25 17:10:39 CEST 2009
Le mardi 25 août 2009 17:53:47 git version control, vous avez écrit :
> atmo filter: disable until it is fixed
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b59d0081f056925f90
> >e9f5b850f13ad416904617
(...)
> #if defined(_ATMO_VLC_PLUGIN_)
> +#error This makes no sense!
> vlc_mutex_lock( &m_WakeupLock );
> vlc_cond_signal( &m_WakeupCond );
> vlc_mutex_unlock( &m_WakeupLock );
A thread condition variable is always associated with a piece of state. There
are no memory access within the lock, so this simply cannot be right. No
wonder there were deadlocks and race conditions in the waiting thread.
> @@ -173,8 +174,10 @@ DWORD CAtmoExternalCaptureInput::Execute(void) {
> void CAtmoExternalCaptureInput::WaitForNextFrame(DWORD timeout)
> {
> this->m_FrameArrived = ATMO_FALSE;
> +#error m_FrameArrived is not protected (no, volatile does not work)
volatile protects against compiler optimization. However it does not provide
atomicity nor memory cache flushes.
> for(DWORD i=0;(i<timeout) && !m_FrameArrived;i++)
> #if defined (_ATMO_VLC_PLUGIN_)
> +#error A condition variable or a semaphore is needed.
> msleep(1000);
This is inefficient.
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list