Commit ed6a92ec authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

signals: fix race condition with sigwait()

The signal thread may catch a signal before the interface thread is
initialized. We need to check signum before the first wait.
parent 425d6074
...@@ -128,8 +128,6 @@ static void Run (intf_thread_t *obj) ...@@ -128,8 +128,6 @@ static void Run (intf_thread_t *obj)
vlc_object_lock (obj); vlc_object_lock (obj);
while (vlc_object_alive (obj)) while (vlc_object_alive (obj))
{ {
vlc_object_wait (obj);
switch (p_sys->signum) switch (p_sys->signum)
{ {
case SIGINT: case SIGINT:
...@@ -140,6 +138,7 @@ static void Run (intf_thread_t *obj) ...@@ -140,6 +138,7 @@ static void Run (intf_thread_t *obj)
strsignal (p_sys->signum)); strsignal (p_sys->signum));
goto out; goto out;
} }
vlc_object_wait (obj);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment