[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/runtime/phonon/xine
From:       Matthias Kretz <kretz () kde ! org>
Date:       2007-12-06 15:13:50
Message-ID: 1196954030.417597.31604.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 745607 by mkretz:

should make no difference, but is easier to understand and should silence helgrind a bit

 M  +4 -7      xinethread.cpp  


--- trunk/KDE/kdebase/runtime/phonon/xine/xinethread.cpp #745606:745607
@@ -19,6 +19,7 @@
 */
 
 #include "xinethread.h"
+#include <QtCore/QMutexLocker>
 #include <QtCore/QTimer>
 #include <QtCore/QCoreApplication>
 #include "xineengine.h"
@@ -55,15 +56,11 @@
 XineStream *XineThread::newStream()
 {
     XineThread *that = XineEngine::thread();
+
+    QMutexLocker locker(&that->m_mutex);
     Q_ASSERT(that->m_newStream == 0);
     QCoreApplication::postEvent(that, new QEVENT(NewStream));
-    if (!that->m_newStream) {
-        that->m_mutex.lock();
-        if (!that->m_newStream) {
-            that->m_waitingForNewStream.wait(&that->m_mutex);
-        }
-        that->m_mutex.unlock();
-    }
+    that->m_waitingForNewStream.wait(&that->m_mutex);
     Q_ASSERT(that->m_newStream);
     XineStream *ret = that->m_newStream;
     that->m_newStream = 0;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic