[vlc-commits] minimal_macosx: simplify killer thread loop

Rémi Denis-Courmont git at videolan.org
Thu Feb 5 21:40:59 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Feb  5 20:46:13 2015 +0200| [9702039ef7a8fd77807d1b4a3ee5d9405574d5fd] | committer: Rémi Denis-Courmont

minimal_macosx: simplify killer thread loop

vlc_object_alive(p_intf) is always true.

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

 modules/gui/minimal_macosx/intf.h |    3 ---
 modules/gui/minimal_macosx/intf.m |   13 +++----------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/modules/gui/minimal_macosx/intf.h b/modules/gui/minimal_macosx/intf.h
index a374504..cc6f2b1 100644
--- a/modules/gui/minimal_macosx/intf.h
+++ b/modules/gui/minimal_macosx/intf.h
@@ -40,8 +40,5 @@
 struct intf_sys_t
 {
     int nothing_for_now;
-
-    vlc_mutex_t lock;
-    vlc_cond_t wait;
 };
 
diff --git a/modules/gui/minimal_macosx/intf.m b/modules/gui/minimal_macosx/intf.m
index 6c7cc5f..d6c73b3 100644
--- a/modules/gui/minimal_macosx/intf.m
+++ b/modules/gui/minimal_macosx/intf.m
@@ -31,6 +31,7 @@
 #ifdef HAVE_CONFIG_H
 # import "config.h"
 #endif
+#include <unistd.h>
 
 #import <vlc_playlist.h>
 #import <vlc_vout_window.h>
@@ -91,16 +92,8 @@ static void * KillerThread(void *user_data)
 
     intf_thread_t *p_intf = user_data;
 
-    vlc_mutex_init(&p_intf->p_sys->lock);
-    vlc_cond_init(&p_intf->p_sys->wait);
-
-    vlc_mutex_lock (&p_intf->p_sys->lock);
-    while(vlc_object_alive(p_intf))
-        vlc_cond_wait(&p_intf->p_sys->wait, &p_intf->p_sys->lock);
-    vlc_mutex_unlock(&p_intf->p_sys->lock);
-
-    vlc_mutex_destroy(&p_intf->p_sys->lock);
-    vlc_cond_destroy(&p_intf->p_sys->wait);
+    for(;;)
+        pause();
 
     /* We are dead, terminate */
     [NSApp terminate: nil];



More information about the vlc-commits mailing list