Changeset 99e8bcdd96b8b3d0997acac002de434f603a75c4

Show
Ignore:
Timestamp:
05/30/08 14:46:32 (3 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1212151592 +0200
git-parent:

[7c9181f67bcbfc2e6a53be2c5731084722e25f33]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1212151573 +0200
Message:

objects: Don't lock parent in vlc_object_attach(). It creates quite hard to resolve dead lock, and hopefully it is safe enough not to lock here. We only risk receiving kill event twice. But given current API it is ok.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/misc/objects.c

    ra9565f3 r99e8bcd  
    838838    p_this->p_parent = p_parent; 
    839839 
    840     vlc_object_lock( p_this->p_parent ); 
    841  
    842840    /* Attach the child to its parent */ 
    843841    vlc_object_internals_t *priv = vlc_internals( p_parent ); 
     
    845843                 p_this ); 
    846844 
    847     /* Kill the object if parent is already dead */ 
    848     if( !vlc_object_alive( p_this->p_parent) ) 
     845    /* Kill the object if parent is already dead. 
     846     * Note: We should surely lock parent here, but that would 
     847     * create quite a few dead lock case. Hopefully, it 
     848     * is perfectly safe to do it that way. We only risk 
     849     * receiving kill event twice. But given current API 
     850     * it is ok. */ 
     851    if( p_this->p_parent->b_die ) 
    849852        vlc_object_kill( p_this ); 
    850853