[vlc-commits] src: remove vlc_object_alive()

Rémi Denis-Courmont git at videolan.org
Wed Jul 1 18:22:14 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 30 23:52:51 2015 +0300| [1f67a0dde5905d9bab283986da7e762da9457d4e] | committer: Rémi Denis-Courmont

src: remove vlc_object_alive()

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

 include/vlc_objects.h |    4 ----
 src/input/input.c     |    4 ----
 src/libvlc.h          |    2 --
 src/libvlccore.sym    |    1 -
 src/misc/objects.c    |   31 -------------------------------
 src/misc/variables.h  |    3 ---
 6 files changed, 45 deletions(-)

diff --git a/include/vlc_objects.h b/include/vlc_objects.h
index 8fa13fe..598313e 100644
--- a/include/vlc_objects.h
+++ b/include/vlc_objects.h
@@ -67,8 +67,4 @@ VLC_API char *vlc_object_get_name( const vlc_object_t * ) VLC_USED;
 #define vlc_list_children(a) \
     vlc_list_children( VLC_OBJECT(a) )
 
-/* Objects and threading */
-VLC_API VLC_USED VLC_DEPRECATED bool vlc_object_alive (vlc_object_t *);
-#define vlc_object_alive(a) vlc_object_alive( VLC_OBJECT(a) )
-
 /** @} */
diff --git a/src/input/input.c b/src/input/input.c
index fff1082..1a547ce 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -219,10 +219,6 @@ int input_Start( input_thread_t *p_input )
  */
 void input_Stop( input_thread_t *p_input )
 {
-    /* Set die for input and ALL of this childrens (even (grand-)grand-childrens)
-     */
-    ObjectKillChildrens( VLC_OBJECT(p_input) );
-
     input_thread_private_t *sys = p_input->p;
 
     vlc_mutex_lock( &sys->lock_control );
diff --git a/src/libvlc.h b/src/libvlc.h
index 8322948..b52df86 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -57,8 +57,6 @@ void vlc_CPU_dump(vlc_object_t *);
 /* This cannot be used as is from plugins yet: */
 int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int);
 
-void ObjectKillChildrens (vlc_object_t *);
-
 int vlc_set_priority( vlc_thread_t, int );
 
 void vlc_threads_setup (libvlc_int_t *);
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 3c24b79..9047646 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -584,7 +584,6 @@ vlc_object_find_name
 vlc_object_hold
 vlc_object_release
 vlc_object_get_name
-vlc_object_alive
 vlc_rand_bytes
 vlc_drand48
 vlc_lrand48
diff --git a/src/misc/objects.c b/src/misc/objects.c
index b34aefd..9ce956b 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -128,7 +128,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
 
         /* Attach the parent to its child (structure lock needed) */
         libvlc_lock (obj->p_libvlc);
-        atomic_init (&priv->alive, atomic_load (&papriv->alive));
         priv->next = papriv->first;
         if (priv->next != NULL)
             priv->next->prev = priv;
@@ -142,7 +141,6 @@ void *vlc_custom_create (vlc_object_t *parent, size_t length,
         obj->i_flags = 0;
         obj->p_libvlc = self;
         obj->p_parent = NULL;
-        atomic_init (&priv->alive, true);
         priv->next = NULL;
         vlc_mutex_init (&(libvlc_priv (self)->structure_lock));
 
@@ -256,24 +254,6 @@ static void vlc_object_destroy( vlc_object_t *p_this )
 }
 
 
-/**
- * Hack for input objects. Should be removed eventually.
- */
-void ObjectKillChildrens( vlc_object_t *p_obj )
-{
-    /* FIXME ObjectKillChildrens seems a very bad idea in fact */
-    /*if( p_obj == VLC_OBJECT(p_input->p->p_sout) ) return;*/
-
-    vlc_object_internals_t *priv = vlc_internals (p_obj);
-    atomic_store(&priv->alive, false);
-
-    vlc_list_t *p_list = vlc_list_children( p_obj );
-    for( int i = 0; i < p_list->i_count; i++ )
-        ObjectKillChildrens( p_list->p_values[i].p_address );
-    vlc_list_release( p_list );
-}
-
-
 #undef vlc_object_find_name
 /**
  * Finds a named object and increment its reference count.
@@ -396,17 +376,6 @@ void vlc_object_release( vlc_object_t *p_this )
     }
 }
 
-#undef vlc_object_alive
-/**
- * This function returns true, except when it returns false.
- * \warning Do not use this function. Ever. You were warned.
- */
-bool vlc_object_alive(vlc_object_t *obj)
-{
-    vlc_object_internals_t *internals = vlc_internals (obj);
-    return atomic_load (&internals->alive);
-}
-
 #undef vlc_list_children
 /**
  * Gets the list of children of an object, and increment their reference
diff --git a/src/misc/variables.h b/src/misc/variables.h
index 7122d94..15d3011 100644
--- a/src/misc/variables.h
+++ b/src/misc/variables.h
@@ -39,9 +39,6 @@ struct vlc_object_internals
     vlc_mutex_t     var_lock;
     vlc_cond_t      var_wait;
 
-    /* Objects thread synchronization */
-    atomic_bool     alive;
-
     /* Objects management */
     atomic_uint     refs;
     vlc_destructor_t pf_destructor;



More information about the vlc-commits mailing list