[vlc-devel] commit: Destroy the playlist AFTER looking for a sout attached to it ( Rafaël Carré )

Rémi Denis-Courmont rdenis at simphalempin.com
Mon May 19 16:48:50 CEST 2008


Le Monday 19 May 2008 14:49:46 Pierre d'Herbemont, vous avez écrit :
> That makes me think, its probably a pity to have implemented such a
> work around in core (remove children, and then call destructor). We
> need an other solution.

It's a choice, not a work-around.

On a high-level, IMHO, there are basically three possible choices:

1) The thread "owning" (typically that which created) the object must detach 
any children before it releases the object.

2) Children are automatically detached when the object is destroyed.

3) A child counts as a reference (either implicit or explicit), such that 
destruction is only performed when (i_children + i_refcount) == 0. Then 
yielding an object with no reference (but still some children) becomes legal.

We are currently doing 1. We used to have 2. I really don't care what we use, 
and I'm OK with changing it once more so long as we stick to it.

Note that only 3 ensures warrants that an attached children can always use its 
parent until detached. I am not sure if it would introduce new deadlocks.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list