Changeset 48c51ebb1336aac7ebb026a128457828782a87d6

Show
Ignore:
Timestamp:
31/05/08 22:56:19 (4 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1212267379 +0300
git-parent:

[070e3454880e849f3ebca21d5f803cdd13351049]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1212267379 +0300
Message:

The not-so-dumb references checker

I saw you, evil preparser thread...

Files:

Legend:

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

    r070e345 r48c51eb  
    15561556        return; 
    15571557 
    1558     /* A thread can use its own object without reference! */ 
     1558    /* A thread can use its own object without references! */ 
    15591559    vlc_object_t *caller = vlc_threadobj (); 
    15601560    if (caller == obj) 
    15611561        return; 
    1562  
     1562#if 0 
    15631563    /* The calling thread is younger than the object. 
    15641564     * Access could be valid through cross-thread synchronization; 
     
    15661566    if (caller && (caller->i_object_id > obj->i_object_id)) 
    15671567        return; 
    1568  
     1568#endif 
    15691569    int refs; 
    15701570    vlc_spin_lock (&priv->ref_spin); 
     
    15721572    vlc_spin_unlock (&priv->ref_spin); 
    15731573 
    1574     /* Object has more than one reference. 
    1575      * The current thread could be holding a valid reference. */ 
    1576     if (refs > 1
    1577         return; 
     1574    for (held_list_t *hlcur = vlc_threadvar_get (&held_objects); 
     1575         hlcur != NULL; hlcur = hlcur->next) 
     1576        if (hlcur->obj == obj
     1577            return; 
    15781578 
    15791579    fprintf (stderr, "The %s %s thread object is accessing...\n" 
    1580              "the %s %s object in a suspicous manner.\n", 
     1580             "the %s %s object without references.\n", 
    15811581             caller && caller->psz_object_name 
    15821582                     ? caller->psz_object_name : "unnamed",