[vlc-devel] commit: dbus control: AFAIK we must lock here. ( Rémi Duraffort )

git version control git at videolan.org
Thu Jan 14 14:27:33 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jan 14 14:10:15 2010 +0100| [60f0938f9d3835cfecc87e8688e1b4c26b5a7275] | committer: Rémi Duraffort 

dbus control: AFAIK we must lock here.

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

 modules/control/dbus.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/control/dbus.c b/modules/control/dbus.c
index ed8f88c..5a4018e 100644
--- a/modules/control/dbus.c
+++ b/modules/control/dbus.c
@@ -419,8 +419,11 @@ DBUS_METHOD( GetCurrentTrack )
     REPLY_INIT;
     OUT_ARGUMENTS;
 
-    /* XXX: how about locking?! */
+    playlist_t *p_playlist = PL;
+
+    PL_LOCK;
     dbus_int32_t i_position = PL->i_current_index;
+    PL_UNLOCK;
 
     ADD_INT32( &i_position );
     REPLY_SEND;
@@ -462,9 +465,11 @@ DBUS_METHOD( GetLength )
 {
     REPLY_INIT;
     OUT_ARGUMENTS;
+    playlist_t *p_playlist = PL;
 
-    /* XXX: how about locking */
+    PL_LOCK;
     dbus_int32_t i_elements = PL->current.i_size;
+    PL_UNLOCK;
 
     ADD_INT32( &i_elements );
     REPLY_SEND;




More information about the vlc-devel mailing list