[vlc-commits] qt/singleton: use vlc::threads

Rémi Denis-Courmont git at videolan.org
Tue Feb 18 19:40:09 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Feb 18 20:06:33 2020 +0200| [0d8ef78058c8ed27c3e3168353da7a6c97ff82ff] | committer: Rémi Denis-Courmont

qt/singleton: use vlc::threads

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

 modules/gui/qt/util/singleton.hpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/util/singleton.hpp b/modules/gui/qt/util/singleton.hpp
index 3467b36c77..4c4221949e 100644
--- a/modules/gui/qt/util/singleton.hpp
+++ b/modules/gui/qt/util/singleton.hpp
@@ -25,6 +25,7 @@
 
 #include <stdlib.h>
 #include <vlc_threads.h>
+#include <vlc_cxx_helpers.hpp>
 
 #include "qt.hpp"
 
@@ -34,7 +35,7 @@ class       Singleton
 public:
     static T*      getInstance( intf_thread_t *p_intf = NULL )
     {
-        vlc_mutex_locker lock( &m_mutex );
+        vlc::threads::mutex_locker lock( m_mutex );
         if ( m_instance == NULL )
             m_instance = new T( p_intf );
         return m_instance;
@@ -42,7 +43,7 @@ public:
 
     static void    killInstance()
     {
-        vlc_mutex_locker lock( &m_mutex );
+        vlc::threads::mutex_locker lock( m_mutex );
         if ( m_instance != NULL )
         {
             delete m_instance;
@@ -59,13 +60,13 @@ protected:
 
 private:
     static T*      m_instance;
-    static vlc_mutex_t m_mutex;
+    static vlc::threads::mutex m_mutex;
 };
 
 template <typename T>
 T*  Singleton<T>::m_instance = NULL;
 
 template <typename T>
-vlc_mutex_t Singleton<T>::m_mutex = VLC_STATIC_MUTEX;
+vlc::threads::mutex Singleton<T>::m_mutex;
 
 #endif // include-guard



More information about the vlc-commits mailing list