From 26d39a90abbfddb9e793a1a92efb3e9fe560dd9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Mon, 22 Oct 2007 17:35:27 +0000 Subject: [PATCH] Don't wait for signal if the object is already dying. Better solution would be to make sure interface threads lock their object ALL THE TIME, except when waiting on its condition variable, so we do never "loose" condition signals. However, I am not sure if this would not result in a deadlock, should the interface need to lock another object (typically, playlist, input and/or vout). Also, we would need to have all thread call vlc_thread_ready(), otherwise, we could also miss the signal if it happens right after the thread is created => this requires fixing every interface, except those that don't have a pf_run. --- include/vlc_objects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vlc_objects.h b/include/vlc_objects.h index bbf3121601..348e56d0f7 100644 --- a/include/vlc_objects.h +++ b/include/vlc_objects.h @@ -159,7 +159,7 @@ vlc_bool_t __vlc_object_lock_and_wait( vlc_object_t *obj ) vlc_bool_t b; vlc_object_lock( obj ); - b = vlc_object_wait( obj ); + b = obj->b_die ? VLC_TRUE : vlc_object_wait( obj ); vlc_object_unlock( obj ); return b; } -- 2.39.2