[vlc-devel] commit: libvlc: Use mutex_cleanup_push. (Pierre d'Herbemont )

git version control git at videolan.org
Wed Jun 3 07:59:47 CEST 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Tue Jun  2 22:57:48 2009 -0700| [ebc50a983a40e0d22f0d5102c3d70364e857ed0b] | committer: Pierre d'Herbemont 

libvlc: Use mutex_cleanup_push.

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

 src/control/event_async.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/control/event_async.c b/src/control/event_async.c
index ef6d675..fb5c15c 100644
--- a/src/control/event_async.c
+++ b/src/control/event_async.c
@@ -223,15 +223,18 @@ static void * event_async_loop(void * arg)
     libvlc_event_t event;
 
     vlc_mutex_lock(&queue(p_em)->lock);
-    vlc_cleanup_push(vlc_cleanup_lock, &queue(p_em)->lock);
     while (true) {
         int has_listener = pop(p_em, &listener, &event);
+
+        mutex_cleanup_push(&queue(p_em)->lock);
+
         if (has_listener)
             listener.pf_callback( &event, listener.p_user_data ); // This might edit the queue, ->lock is recursive
         else
             vlc_cond_wait(&queue(p_em)->signal, &queue(p_em)->lock);
+
+        vlc_cleanup_pop();
     }
-    vlc_cleanup_pop();
     vlc_mutex_unlock(&queue(p_em)->lock);
     return NULL;
 }




More information about the vlc-devel mailing list