[vlc-devel] commit: Signals: only one thread needed now ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Sep 3 21:43:11 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Sep 3 22:30:41 2008 +0300| [67c077deff2a3d7351cf85d29ce4ef657e5e2757] | committer: Rémi Denis-Courmont
Signals: only one thread needed now
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=67c077deff2a3d7351cf85d29ce4ef657e5e2757
---
modules/control/signals.c | 27 ++++-----------------------
1 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/modules/control/signals.c b/modules/control/signals.c
index 9316d21..9c945c3 100644
--- a/modules/control/signals.c
+++ b/modules/control/signals.c
@@ -31,7 +31,6 @@
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
-static void Run (intf_thread_t *);
static void *SigThread (void *);
vlc_module_begin ();
@@ -67,7 +66,7 @@ static int Open (vlc_object_t *obj)
return VLC_ENOMEM;
}
- intf->pf_run = Run;
+ intf->pf_run = NULL;
return 0;
}
@@ -113,21 +112,7 @@ static void *SigThread (void *data)
vlc_testcancel();
#endif
- vlc_object_lock (obj);
- p_sys->signum = signum;
- vlc_object_signal_unlocked (obj);
- vlc_object_unlock (obj);
- }
-}
-
-static void Run (intf_thread_t *obj)
-{
- intf_sys_t *p_sys = obj->p_sys;
-
- vlc_object_lock (obj);
- while (vlc_object_alive (obj))
- {
- switch (p_sys->signum)
+ switch (signum)
{
case SIGINT:
case SIGHUP:
@@ -135,12 +120,8 @@ static void Run (intf_thread_t *obj)
case SIGQUIT:
msg_Err (obj, "Caught %s signal, exiting...",
strsignal (p_sys->signum));
- goto out;
+ vlc_object_kill (obj->p_libvlc);
+ break;
}
- vlc_object_wait (obj);
}
-
-out:
- vlc_object_unlock (obj);
- vlc_object_kill (obj->p_libvlc);
}
More information about the vlc-devel
mailing list