[vlc-devel] commit: httpd: Fix vlc_object_wait() usage. It' s needed to check if we were not already killed before calling vlc_object_wait (). Thanks to William King for spotting the deadlock. (Pierre d'Herbemont )

git version control git at videolan.org
Tue Apr 22 17:11:07 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Apr 22 17:11:46 2008 +0200| [baffdc120c6a63cc32988535578f44158deb59d5]

httpd: Fix vlc_object_wait() usage. It's needed to check if we were not already killed before calling vlc_object_wait(). Thanks to William King for spotting the deadlock.

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

 src/network/httpd.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/network/httpd.c b/src/network/httpd.c
index 97947da..dad2c14 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -2455,7 +2455,11 @@ static void httpd_HostThread( httpd_host_t *host )
 
         vlc_object_lock( host );
         if( ufd[nfd - 1].revents )
-            b_die = vlc_object_wait( host );
+        {
+            b_die = !vlc_object_alive( host );
+            if( !b_die )
+                b_die = vlc_object_wait( host );
+        }
         vlc_object_unlock( host );
 
         /* Handle client sockets */




More information about the vlc-devel mailing list