[vlc-commits] Lua: revert should_die to using vlc_object_alive()

Rémi Denis-Courmont git at videolan.org
Sun Mar 25 19:44:27 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Mar 25 20:43:57 2012 +0300| [fad80b62d815ef01aeed1cb59f208a3ef6fec35b] | committer: Rémi Denis-Courmont

Lua: revert should_die to using vlc_object_alive()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fad80b62d815ef01aeed1cb59f208a3ef6fec35b
---

 modules/lua/intf.c      |   10 ----------
 modules/lua/libs/misc.c |    4 ++--
 modules/lua/vlc.h       |    2 --
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index a807a99..e5da999 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -362,12 +362,8 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
 
     p_sys->L = L;
 
-    vlc_mutex_init( &p_sys->lock );
-    p_sys->exiting = false;
-
     if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) )
     {
-        vlc_mutex_destroy( &p_sys->lock );
         lua_close( p_sys->L );
         goto error;
     }
@@ -387,13 +383,7 @@ void Close_LuaIntf( vlc_object_t *p_this )
     intf_sys_t *p_sys = p_intf->p_sys;
 
     vlc_cancel( p_sys->thread );
-
-    vlc_mutex_lock( &p_sys->lock );
-    p_sys->exiting = true;
-    vlc_mutex_unlock( &p_sys->lock );
     vlc_join( p_sys->thread, NULL );
-    vlc_mutex_destroy( &p_sys->lock );
-
     lua_close( p_sys->L );
 
     free( p_sys->psz_filename );
diff --git a/modules/lua/libs/misc.c b/modules/lua/libs/misc.c
index a7e6a5b..4b5cd80 100644
--- a/modules/lua/libs/misc.c
+++ b/modules/lua/libs/misc.c
@@ -147,8 +147,8 @@ static int vlclua_mwait( lua_State *L )
 
 static int vlclua_intf_should_die( lua_State *L )
 {
-    intf_sys_t *p_sys = vlclua_get_intf( L );
-    lua_pushboolean( L, p_sys->exiting );
+    vlc_object_t *p_this = vlclua_get_this( L );
+    lua_pushboolean( L, !vlc_object_alive( p_this ) );
     return 1;
 }
 
diff --git a/modules/lua/vlc.h b/modules/lua/vlc.h
index 3683bd2..052b7af 100644
--- a/modules/lua/vlc.h
+++ b/modules/lua/vlc.h
@@ -164,8 +164,6 @@ struct intf_sys_t
     lua_State *L;
 
     vlc_thread_t thread;
-    vlc_mutex_t lock;
-    bool exiting;
 };
 
 #endif /* VLC_LUA_H */



More information about the vlc-commits mailing list