Changeset 56040f0bb0de6f862deb28bcd62a1373403a6ce8
- 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
| rbe50cf5 |
r56040f0 |
|
| 556 | 556 | volatile vlc_bool_t b_die; /**< set by the outside */ \ |
|---|
| 557 | 557 | volatile vlc_bool_t b_dead; /**< set by the object */ \ |
|---|
| 558 | | volatile vlc_bool_t b_attached; /**< set by the object */ \ |
|---|
| 559 | 558 | vlc_bool_t b_force; /**< set by the outside (eg. module_Need()) */ \ |
|---|
| 560 | 559 | \ |
|---|
| rcfb432c |
r56040f0 |
|
| 219 | 219 | vlc_thread_set_priority( p_libvlc, VLC_THREAD_PRIORITY_LOW ); |
|---|
| 220 | 220 | #endif |
|---|
| 221 | | /* Fake attachment */ |
|---|
| 222 | | p_libvlc->b_attached = VLC_TRUE; |
|---|
| 223 | 221 | /* Store data for the non-reentrant API */ |
|---|
| 224 | 222 | p_static_vlc = p_libvlc; |
|---|
| raa5d11c |
r56040f0 |
|
| 113 | 113 | vlc_thread_t thread_id; |
|---|
| 114 | 114 | vlc_bool_t b_thread; |
|---|
| | 115 | |
|---|
| | 116 | /* Objects management */ |
|---|
| | 117 | vlc_bool_t b_attached; |
|---|
| 115 | 118 | }; |
|---|
| 116 | 119 | |
|---|
| ra9e4de1 |
r56040f0 |
|
| 121 | 121 | p_new->b_error = VLC_FALSE; |
|---|
| 122 | 122 | p_new->b_dead = VLC_FALSE; |
|---|
| 123 | | p_new->b_attached = VLC_FALSE; |
|---|
| | 123 | p_priv->b_attached = VLC_FALSE; |
|---|
| 124 | 124 | p_new->b_force = VLC_FALSE; |
|---|
| 125 | 125 | |
|---|
| … | … | |
| 154 | 154 | p_libvlc_global->pp_objects = malloc( sizeof(vlc_object_t *) ); |
|---|
| 155 | 155 | p_libvlc_global->pp_objects[0] = p_new; |
|---|
| 156 | | p_new->b_attached = VLC_TRUE; |
|---|
| | 156 | p_priv->b_attached = VLC_TRUE; |
|---|
| 157 | 157 | } |
|---|
| 158 | 158 | else |
|---|
| 159 | 159 | { |
|---|
| 160 | 160 | 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 | } |
|---|
| 163 | 170 | |
|---|
| 164 | 171 | vlc_mutex_lock( &structure_lock ); |
|---|
| … | … | |
| 676 | 683 | |
|---|
| 677 | 684 | /* 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 ) |
|---|
| 679 | 686 | { |
|---|
| 680 | 687 | SetAttachment( p_this, VLC_TRUE ); |
|---|
| … | … | |
| 703 | 710 | |
|---|
| 704 | 711 | /* 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 ) |
|---|
| 706 | 713 | { |
|---|
| 707 | 714 | SetAttachment( p_this, VLC_FALSE ); |
|---|
| … | … | |
| 738 | 745 | for( ; pp_current < pp_end ; pp_current++ ) |
|---|
| 739 | 746 | { |
|---|
| 740 | | if( (*pp_current)->b_attached |
|---|
| | 747 | if( (*pp_current)->p_internals->b_attached |
|---|
| 741 | 748 | && (*pp_current)->i_object_type == i_type ) |
|---|
| 742 | 749 | { |
|---|
| … | … | |
| 750 | 757 | for( ; pp_current < pp_end ; pp_current++ ) |
|---|
| 751 | 758 | { |
|---|
| 752 | | if( (*pp_current)->b_attached |
|---|
| | 759 | if( (*pp_current)->p_internals->b_attached |
|---|
| 753 | 760 | && (*pp_current)->i_object_type == i_type ) |
|---|
| 754 | 761 | { |
|---|
| … | … | |
| 810 | 817 | for( ; pp_current < pp_end ; pp_current++ ) |
|---|
| 811 | 818 | { |
|---|
| 812 | | if( (*pp_current)->b_attached ) |
|---|
| | 819 | if( (*pp_current)->p_internals->b_attached ) |
|---|
| 813 | 820 | { |
|---|
| 814 | 821 | PrintObject( *pp_current, "" ); |
|---|
| … | … | |
| 1180 | 1187 | } |
|---|
| 1181 | 1188 | |
|---|
| 1182 | | p_this->b_attached = b_attached; |
|---|
| | 1189 | p_this->p_internals->b_attached = b_attached; |
|---|
| 1183 | 1190 | } |
|---|
| 1184 | 1191 | |
|---|