Commit ebc50a98 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: Use mutex_cleanup_push.

parent 63019159
...@@ -223,15 +223,18 @@ static void * event_async_loop(void * arg) ...@@ -223,15 +223,18 @@ static void * event_async_loop(void * arg)
libvlc_event_t event; libvlc_event_t event;
vlc_mutex_lock(&queue(p_em)->lock); vlc_mutex_lock(&queue(p_em)->lock);
vlc_cleanup_push(vlc_cleanup_lock, &queue(p_em)->lock);
while (true) { while (true) {
int has_listener = pop(p_em, &listener, &event); int has_listener = pop(p_em, &listener, &event);
mutex_cleanup_push(&queue(p_em)->lock);
if (has_listener) if (has_listener)
listener.pf_callback( &event, listener.p_user_data ); // This might edit the queue, ->lock is recursive listener.pf_callback( &event, listener.p_user_data ); // This might edit the queue, ->lock is recursive
else else
vlc_cond_wait(&queue(p_em)->signal, &queue(p_em)->lock); vlc_cond_wait(&queue(p_em)->signal, &queue(p_em)->lock);
vlc_cleanup_pop();
} }
vlc_cleanup_pop();
vlc_mutex_unlock(&queue(p_em)->lock); vlc_mutex_unlock(&queue(p_em)->lock);
return NULL; return NULL;
} }
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