Changeset 56040f0bb0de6f862deb28bcd62a1373403a6ce8

Show
Ignore:
Timestamp:
19/08/07 19:15:11 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1187543711 +0000
git-parent:

[46c366a825accfc0d1b7b7f446c820f6713037fd]

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

Hide b_attached.
Also remove the volatile qualifier.
No, volatile does not magically solve threading bugs, sorry
I too have tried this "easy" path, it does REALLY NOT WORK.
volatile only solves signals concurrency, not threads concurrency.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_common.h

    rbe50cf5 r56040f0  
    556556    volatile vlc_bool_t b_die;                   /**< set by the outside */ \ 
    557557    volatile vlc_bool_t b_dead;                   /**< set by the object */ \ 
    558     volatile vlc_bool_t b_attached;               /**< set by the object */ \ 
    559558    vlc_bool_t b_force;      /**< set by the outside (eg. module_Need()) */ \ 
    560559                                                                            \ 
  • src/libvlc-common.c

    rcfb432c r56040f0  
    219219    vlc_thread_set_priority( p_libvlc, VLC_THREAD_PRIORITY_LOW ); 
    220220#endif 
    221     /* Fake attachment */ 
    222     p_libvlc->b_attached = VLC_TRUE; 
    223221    /* Store data for the non-reentrant API */ 
    224222    p_static_vlc = p_libvlc; 
  • src/libvlc.h

    raa5d11c r56040f0  
    113113    vlc_thread_t thread_id; 
    114114    vlc_bool_t   b_thread; 
     115 
     116    /* Objects management */ 
     117    vlc_bool_t      b_attached; 
    115118}; 
    116119 
  • src/misc/objects.c

    ra9e4de1 r56040f0  
    121121    p_new->b_error = VLC_FALSE; 
    122122    p_new->b_dead = VLC_FALSE; 
    123     p_new->b_attached = VLC_FALSE; 
     123    p_priv->b_attached = VLC_FALSE; 
    124124    p_new->b_force = VLC_FALSE; 
    125125 
     
    154154        p_libvlc_global->pp_objects = malloc( sizeof(vlc_object_t *) ); 
    155155        p_libvlc_global->pp_objects[0] = p_new; 
    156         p_new->b_attached = VLC_TRUE; 
     156        p_priv->b_attached = VLC_TRUE; 
    157157    } 
    158158    else 
    159159    { 
    160160        libvlc_global_data_t *p_libvlc_global = vlc_global(); 
    161         p_new->p_libvlc = ( i_type == VLC_OBJECT_LIBVLC ) ? (libvlc_int_t*)p_new 
    162                                                        : p_this->p_libvlc; 
     161        if( i_type == VLC_OBJECT_LIBVLC ) 
     162        { 
     163        p_new->p_libvlc = (libvlc_int_t*)p_new; 
     164            p_priv->b_attached = VLC_TRUE; 
     165        } 
     166        else 
     167        { 
     168            p_new->p_libvlc = p_this->p_libvlc; 
     169        } 
    163170 
    164171        vlc_mutex_lock( &structure_lock ); 
     
    676683 
    677684    /* Climb up the tree to see whether we are connected with the root */ 
    678     if( p_parent->b_attached ) 
     685    if( p_parent->p_internals->b_attached ) 
    679686    { 
    680687        SetAttachment( p_this, VLC_TRUE ); 
     
    703710 
    704711    /* Climb up the tree to see whether we are connected with the root */ 
    705     if( p_this->p_parent->b_attached ) 
     712    if( p_this->p_parent->p_internals->b_attached ) 
    706713    { 
    707714        SetAttachment( p_this, VLC_FALSE ); 
     
    738745        for( ; pp_current < pp_end ; pp_current++ ) 
    739746        { 
    740             if( (*pp_current)->b_attached 
     747            if( (*pp_current)->p_internals->b_attached 
    741748                 && (*pp_current)->i_object_type == i_type ) 
    742749            { 
     
    750757        for( ; pp_current < pp_end ; pp_current++ ) 
    751758        { 
    752             if( (*pp_current)->b_attached 
     759            if( (*pp_current)->p_internals->b_attached 
    753760                 && (*pp_current)->i_object_type == i_type ) 
    754761            { 
     
    810817        for( ; pp_current < pp_end ; pp_current++ ) 
    811818        { 
    812             if( (*pp_current)->b_attached ) 
     819            if( (*pp_current)->p_internals->b_attached ) 
    813820            { 
    814821                PrintObject( *pp_current, "" ); 
     
    11801187    } 
    11811188 
    1182     p_this->b_attached = b_attached; 
     1189    p_this->p_internals->b_attached = b_attached; 
    11831190} 
    11841191