[vlc-devel] commit: libvlc: Make sure no event will be send after _detach from the asynch thread. ( Pierre d'Herbemont )

Pierre d'Herbemont pdherbemont at free.fr
Thu Jun 4 21:19:05 CEST 2009


On Thu, Jun 4, 2009 at 12:29 AM, Laurent Aimar <fenrir at via.ecp.fr> wrote:
> Hi,
>
> On Thu, Jun 04, 2009, git version control wrote:
>> +    bool is_asynch_dispatch_thread = vlc_threadvar_get(queue(p_em)->is_asynch_dispatch_thread_var);
>> +
>> +    // Wait for the asynch_loop to have processed all events.
>> +    if(!queue(p_em)->is_idle && !is_asynch_dispatch_thread)
>> +    {
>> +        vlc_cond_wait(&queue(p_em)->signal_idle, &queue(p_em)->lock);
>> +        assert(queue(p_em)->is_idle);
>> +    }
>  vlc_cond_wait is probably mis-used here. A vlc_cond_wait/timedwait can and
> will wakeup without having been signaled. So either you support supurious wake-up
> (and the assert+comment seems wrong, or a while() has to be added.

Thanks. This was forgotten.

>>              mutex_cleanup_push(&queue(p_em)->lock);
>> +            vlc_cond_broadcast(&queue(p_em)->signal_idle); // We'll be idle
>>              vlc_cond_wait(&queue(p_em)->signal, &queue(p_em)->lock);
>  Probably the same here.

Not in this case.

Thanks for reviewing.



More information about the vlc-devel mailing list