[vlc-devel] commit: Remove dead code (vlc_object_timedwait) ( Rémi Denis-Courmont )

Rémi Denis-Courmont rdenis at simphalempin.com
Tue Sep 9 08:41:00 CEST 2008


On Mon, 8 Sep 2008 22:55:15 +0200, Pierre d'Herbemont <pdherbemont at free.fr>
wrote:
> 
> On Sep 8, 2008, at 10:51 PM, Pierre d'Herbemont wrote:
> 
>> What is the point of this commit?
>>
>> This is more than useful given current vlc architecture.
> 
> Well, true enough, I forgot that we actually did change how
> cancellation is handled :) A warning would have been more appropriate
> here.

vlc_object_timedwait() assume any single thread wait uses one object. This
sucks when you do not have an object (e.g. block_Fifo), do not want to use
it, or have different unrelated events that you do not want to multiplex on
a single condition variable. And then all objects up the hierarchy have to
have one thread, so that vlc_object_kill() propagates properly. I just got
the API totally wrong to begin with. Of course, vlc_object_wait() and
vlc_object_waitpipe() exhibit the same issue.

Besides, the one single remaining use of vlc_object_timedwait() seemed
quite wrong...

IMHO, we need to separate threading from objects. That would also help with
the object reference counting mess. That leaves three options:
- msleep() polling... *ahem*
- cond_wait() with (top-down) cancellation,
- cond_wait() with bottom-up interruption notification
  (+ rework of the thread API internals to implement this)

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list