Changeset b1b63c31bdcf3823aa2a6479cda00bc5aee9624c

Show
Ignore:
Timestamp:
05/07/08 22:19:10 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210191550 +0300
git-parent:

[ef33cb40a80a612b7ac8f3eb0f05e2b6cbec945c]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210191550 +0300
Message:

No need to take the structure lock when finding oneself

as we don't go through the object table and links.

Files:

Legend:

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

    ref33cb4 rb1b63c3  
    743743    vlc_object_t *p_found; 
    744744 
    745     vlc_mutex_lock( &structure_lock ); 
    746  
    747     assert( vlc_internals( p_this )->i_refcount > 0 ); 
    748  
    749745    /* If we are of the requested type ourselves, don't look further */ 
    750746    if( !(i_mode & FIND_STRICT) && p_this->i_object_type == i_type ) 
    751747    { 
    752748        vlc_object_yield( p_this ); 
    753         vlc_mutex_unlock( &structure_lock ); 
    754749        return p_this; 
    755750    } 
     751 
     752    vlc_mutex_lock( &structure_lock ); 
    756753 
    757754    /* Otherwise, recursively look for the object */ 
     
    796793    vlc_object_t *p_found; 
    797794 
    798     vlc_mutex_lock( &structure_lock ); 
    799  
    800795    /* If have the requested name ourselves, don't look further */ 
    801796    if( !(i_mode & FIND_STRICT) 
     
    804799    { 
    805800        vlc_object_yield( p_this ); 
    806         vlc_mutex_unlock( &structure_lock ); 
    807801        return p_this; 
    808802    } 
     803 
     804    vlc_mutex_lock( &structure_lock ); 
    809805 
    810806    /* Otherwise, recursively look for the object */