From: RĂ©mi Denis-Courmont Date: Thu, 28 Aug 2008 20:39:44 +0000 (+0300) Subject: vlc_object_lock_and_wait: broken by design, remove X-Git-Tag: 1.0.0-pre1~3711 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=1014a2aa09d4c4a529407b221676f9138416660b;p=vlc vlc_object_lock_and_wait: broken by design, remove The only user is LUA, inlined there. The return value seems suspicious by the way. --- diff --git a/include/vlc_objects.h b/include/vlc_objects.h index c31436c117..a75a9b0d1f 100644 --- a/include/vlc_objects.h +++ b/include/vlc_objects.h @@ -177,26 +177,3 @@ static inline bool __vlc_object_alive (const vlc_object_t *obj) VLC_EXPORT( int, __vlc_object_waitpipe, ( vlc_object_t *obj )); #define vlc_object_waitpipe(a) \ __vlc_object_waitpipe( VLC_OBJECT(a) ) - -/* NOTE: this function is a *temporary* convenience. - * See the vlc_object_alive() documentation for a better alternative. - */ -static inline -bool __vlc_object_lock_and_wait( vlc_object_t *obj ) -{ - bool b; - - vlc_object_lock( obj ); - b = vlc_object_alive( obj ); - if( b ) - { - vlc_object_wait( obj ); - b = vlc_object_alive( obj ); - } - vlc_object_unlock( obj ); - return b; -} -#define vlc_object_lock_and_wait( obj ) \ - __vlc_object_lock_and_wait( VLC_OBJECT(obj) ) - - diff --git a/modules/misc/lua/libs/misc.c b/modules/misc/lua/libs/misc.c index 6efec4aa5e..08804a17d3 100644 --- a/modules/misc/lua/libs/misc.c +++ b/modules/misc/lua/libs/misc.c @@ -171,7 +171,15 @@ static int vlclua_datadir_list( lua_State *L ) static int vlclua_lock_and_wait( lua_State *L ) { vlc_object_t *p_this = vlclua_get_this( L ); - int b_quit = vlc_object_lock_and_wait( p_this ); + int b_quit; + + vlc_object_lock( p_this ); + b_quit = vlc_object_alive( p_this ); + if( b_quit ) + { + vlc_object_wait( p_this ); + b_quit = vlc_object_alive( p_this ); + } lua_pushboolean( L, b_quit ); return 1; }