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

Really fix race VLC_Die condition

parent 8274a40e
...@@ -242,16 +242,18 @@ static void *SigHandler (void *data) ...@@ -242,16 +242,18 @@ static void *SigHandler (void *data)
} }
static void KillOnce (void) #include <stdbool.h>
{
VLC_Die (0);
}
static void Kill (void) static void Kill (void)
{ {
static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
pthread_once (&once, KillOnce); static bool killed = false;;
pthread_mutex_lock (&lock);
if (!killed)
{
VLC_Die (0);
killed = true;
}
pthread_mutex_unlock (&lock);
} }
#endif #endif
......
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