[vlc-devel] commit: VLM: cleanup VLM threading ( Rémi Denis-Courmont )
git version control
git at videolan.org
Mon Aug 25 18:38:43 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Aug 24 16:12:42 2008 +0300| [d745c19b21432e69b27af4f92782c4814fc24d0d] | committer: Rémi Denis-Courmont
VLM: cleanup VLM threading
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d745c19b21432e69b27af4f92782c4814fc24d0d
---
src/input/vlm.c | 17 +++++------------
src/input/vlm_internal.h | 3 ++-
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/input/vlm.c b/src/input/vlm.c
index 4a92e60..c511c7c 100644
--- a/src/input/vlm.c
+++ b/src/input/vlm.c
@@ -62,7 +62,7 @@
*****************************************************************************/
static void vlm_Destructor( vlm_t *p_vlm );
-static void* Manage( vlc_object_t * );
+static void* Manage( void * );
static int vlm_MediaVodControl( void *, vod_media_t *, const char *, int, va_list );
/*****************************************************************************
@@ -108,8 +108,7 @@ vlm_t *__vlm_New ( vlc_object_t *p_this )
p_vlm->p_vod = NULL;
vlc_object_attach( p_vlm, p_this->p_libvlc );
- if( vlc_thread_create( p_vlm, "vlm thread",
- Manage, VLC_THREAD_PRIORITY_LOW, false ) )
+ if( vlc_clone( &p_vlm->thread, Manage, p_vlm, VLC_THREAD_PRIORITY_LOW ) )
{
vlc_mutex_destroy( &p_vlm->lock );
vlc_object_release( p_vlm );
@@ -155,11 +154,6 @@ void vlm_Delete( vlm_t *p_vlm )
* is serialized against setting libvlc_priv->p_vlm from vlm_New(). */
var_Get( p_vlm->p_libvlc, "vlm_mutex", &lockval );
vlc_mutex_lock( lockval.p_address );
- /* Parental advisory: terrific humongous horrible follows...
- * This is so that vlc_object_destroy() (from vlc_object_release()) will
- * NOT join our thread. See also vlm_Destructor().
- * -- Courmisch, 24/08/2008 */
- vlc_internals( p_vlm )->b_thread = false;
vlc_object_release( p_vlm );
vlc_mutex_unlock( lockval.p_address );
}
@@ -178,9 +172,8 @@ static void vlm_Destructor( vlm_t *p_vlm )
TAB_CLEAN( p_vlm->schedule, p_vlm->schedule );
vlc_object_kill( p_vlm );
- /* Continuation of the vlm_Delete() hack. -- Courmisch */
- vlc_internals( p_vlm )->b_thread = true;
- vlc_thread_join( p_vlm );
+ /*vlc_cancel( p_vlm->thread ); */
+ vlc_join( p_vlm->thread, NULL );
vlc_mutex_destroy( &p_vlm->lock );
}
@@ -309,7 +302,7 @@ static int vlm_MediaVodControl( void *p_private, vod_media_t *p_vod_media,
/*****************************************************************************
* Manage:
*****************************************************************************/
-static void* Manage( vlc_object_t* p_object )
+static void* Manage( void* p_object )
{
vlm_t *vlm = (vlm_t*)p_object;
int i, j;
diff --git a/src/input/vlm_internal.h b/src/input/vlm_internal.h
index a751cf3..670f5a1 100644
--- a/src/input/vlm_internal.h
+++ b/src/input/vlm_internal.h
@@ -87,7 +87,8 @@ struct vlm_t
{
VLC_COMMON_MEMBERS
- vlc_mutex_t lock;
+ vlc_mutex_t lock;
+ vlc_thread_t thread;
/* */
int64_t i_id;
More information about the vlc-devel
mailing list