Commit 18be28ae authored by Rafaël Carré's avatar Rafaël Carré

make vlc_object_timedwait() return immediately if the object or libvlc is dying

parent 8cc57c7a
...@@ -545,6 +545,8 @@ int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline ) ...@@ -545,6 +545,8 @@ int __vlc_object_timedwait( vlc_object_t *obj, mtime_t deadline )
int v; int v;
vlc_assert_locked( &obj->object_lock ); vlc_assert_locked( &obj->object_lock );
if( obj->b_die || obj->p_libvlc->b_die )
return -1; /* don't wait if we are dying */
v = vlc_cond_timedwait( &obj->object_wait, &obj->object_lock, deadline ); v = vlc_cond_timedwait( &obj->object_wait, &obj->object_lock, deadline );
if( v == 0 ) /* signaled */ if( v == 0 ) /* signaled */
return obj->b_die ? -1 : 1; return obj->b_die ? -1 : 1;
......
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