[vlmc-devel] ClipWorkflow: Any boolean read/write operation is already atomic.

Hugo Beauzée-Luyssen git at videolan.org
Fri Jan 24 19:37:04 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Jan 24 19:46:37 2014 +0200| [96ebf234ae93d3e2072d1440bff559d171c378a5] | committer: Hugo Beauzée-Luyssen

ClipWorkflow: Any boolean read/write operation is already atomic.

The logic is safe even if the value changes in the middle of a check

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=96ebf234ae93d3e2072d1440bff559d171c378a5
---

 src/Workflow/ClipWorkflow.cpp |    6 +++---
 src/Workflow/ClipWorkflow.h   |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Workflow/ClipWorkflow.cpp b/src/Workflow/ClipWorkflow.cpp
index b6a520e..58d0f34 100644
--- a/src/Workflow/ClipWorkflow.cpp
+++ b/src/Workflow/ClipWorkflow.cpp
@@ -300,15 +300,15 @@ ClipWorkflow::unmute()
 void
 ClipWorkflow::requireResync()
 {
-    m_resyncRequired = 1;
+    m_resyncRequired = true;
 }
 
 bool
 ClipWorkflow::isResyncRequired()
 {
-    if ( m_resyncRequired == 1 )
+    if ( m_resyncRequired == true )
     {
-        m_resyncRequired = 0;
+        m_resyncRequired = false;
         return true;
     }
     return false;
diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index 61e2663..42c3daf 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -251,7 +251,7 @@ class   ClipWorkflow : public EffectUser
          *  Basically, this will be used when a clip is moved, and therefore has to be
          *  updated.
          */
-        QAtomicInt              m_resyncRequired;
+        bool                    m_resyncRequired;
 
     protected:
         LibVLCpp::MediaPlayer*  m_mediaPlayer;



More information about the Vlmc-devel mailing list