[vlc-commits] vlc_sem_wait: add missing cleanup handler

Rémi Denis-Courmont git at videolan.org
Wed Nov 14 17:10:28 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 14 18:10:14 2012 +0200| [1a5ea5894dac3480272bd4f4650124f1b0a0d954] | committer: Rémi Denis-Courmont

vlc_sem_wait: add missing cleanup handler

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

 src/misc/threads.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/misc/threads.c b/src/misc/threads.c
index 13e0437..3d51708 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -166,9 +166,10 @@ int vlc_sem_post (vlc_sem_t *sem)
 void vlc_sem_wait (vlc_sem_t *sem)
 {
     vlc_mutex_lock (&sem->lock);
+    mutex_cleanup_push (&lock->mutex);
     while (!sem->value)
         vlc_cond_wait (&sem->wait, &sem->lock);
     sem->value--;
-    vlc_mutex_unlock (&sem->lock);
+    vlc_cleanup_run ();
 }
 #endif /* LIBVLC_NEED_SEMAPHORE */



More information about the vlc-commits mailing list