[vlc-devel] commit: Small race condition ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Apr 16 17:36:59 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 16 18:33:39 2009 +0300| [03d82d1d7e534494dd79373ce0616ccdb009e02a] | committer: Rémi Denis-Courmont 

Small race condition

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

 modules/access/rtp/input.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules/access/rtp/input.c b/modules/access/rtp/input.c
index 622e914..963fe3d 100644
--- a/modules/access/rtp/input.c
+++ b/modules/access/rtp/input.c
@@ -203,6 +203,7 @@ int rtp_process (demux_t *demux)
 {
     demux_sys_t *p_sys = demux->p_sys;
     mtime_t deadline = INT64_MAX;
+    int ret;
 
     vlc_mutex_lock (&p_sys->lock);
     if (rtp_dequeue (demux, p_sys->session, &deadline))
@@ -210,7 +211,8 @@ int rtp_process (demux_t *demux)
         vlc_cond_timedwait (&p_sys->wait, &p_sys->lock, deadline);
     else
         vlc_cond_wait (&p_sys->wait, &p_sys->lock);
+    ret = p_sys->dead ? -1 : 0;
     vlc_mutex_unlock (&p_sys->lock);
 
-    return p_sys->dead ? -1 : 0;
+    return ret;
 }




More information about the vlc-devel mailing list