[vlc-devel] commit: Init the structure lock just once ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Aug 30 13:23:12 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Aug 30 14:21:22 2008 +0300| [f3c2c887cf69851b90f2ca45c9e71c65c1ecabfa] | committer: Rémi Denis-Courmont 

Init the structure lock just once

(should probably be a per-instance lock instead though)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f3c2c887cf69851b90f2ca45c9e71c65c1ecabfa
---

 src/misc/objects.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 1acb140..769b76e 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -147,10 +147,12 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
         if( i_type == VLC_OBJECT_LIBVLC )
             p_new->p_libvlc = (libvlc_int_t*)p_new;
         else
+        {
             p_new->p_libvlc = NULL;
+            vlc_mutex_init( &structure_lock );
+        }
 
         p_this = p_priv->next = p_priv->prev = p_new;
-        vlc_mutex_init( &structure_lock );
     }
     else
         p_new->p_libvlc = p_this->p_libvlc;




More information about the vlc-devel mailing list