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

List:       kde-commits
Subject:    [simon/mac] simonlib/simoncontextdetection: Remove unnecessary locking
From:       Peter Grasch <me () bedahr ! org>
Date:       2014-03-31 19:09:25
Message-ID: E1WUhaH-000362-89 () scm ! kde ! org
[Download RAW message or body]

Git commit 435537c410dac67d4311df63a2c87690f4240e5d by Peter Grasch.
Committed on 31/03/2014 at 18:54.
Pushed by grasch into branch 'mac'.

Remove unnecessary locking

M  +0    -4    simonlib/simoncontextdetection/processinfogatherer.cpp
M  +0    -6    simonlib/simoncontextdetection/processinfogatherer.h

http://commits.kde.org/simon/435537c410dac67d4311df63a2c87690f4240e5d

diff --git a/simonlib/simoncontextdetection/processinfogatherer.cpp \
b/simonlib/simoncontextdetection/processinfogatherer.cpp index 1d43156..20efa0c \
                100644
--- a/simonlib/simoncontextdetection/processinfogatherer.cpp
+++ b/simonlib/simoncontextdetection/processinfogatherer.cpp
@@ -30,9 +30,7 @@ ProcessInfoGatherer::ProcessInfoGatherer(QObject *parent) :
 
 ProcessInfoGatherer::~ProcessInfoGatherer()
 {
-    m_mutex.lock();
     m_abort = true;
-    m_mutex.unlock();
 
     wait();
 }
@@ -84,10 +82,8 @@ void ProcessInfoGatherer::run()
 
         //emit finishedGatheringStep();
 
-        m_mutex.lock();
         if (m_abort)
             return;
-        m_mutex.unlock();
 
         this->sleep(1);
     }
diff --git a/simonlib/simoncontextdetection/processinfogatherer.h \
b/simonlib/simoncontextdetection/processinfogatherer.h index 9f0f5fe..8b95a54 100644
--- a/simonlib/simoncontextdetection/processinfogatherer.h
+++ b/simonlib/simoncontextdetection/processinfogatherer.h
@@ -26,7 +26,6 @@
 
 #include <QThread>
 #include <QStringList>
-#include <QMutex>
 
 /**
  *	@class ProcessInfoGatherer
@@ -65,11 +64,6 @@ private:
       */
     bool m_abort;
 
-    /** \brief Mutex used to make sure that \var m_abort is only accessed by one \
                thread at a time
-      *
-      */
-    QMutex m_mutex;
-
 protected:
     /** \brief Reimplemented run() function which contains the main loop of the \
                ProcessInfoGatherer
       *


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

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