gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2060-g81c3368
Date: Sun, 25 May 2014 23:06:33 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  81c33684e54e89c0f48910578818b8ae7c3216b9 (commit)
      from  09585f0bc892b1a5370edc46437583c26948db1e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=81c33684e54e89c0f48910578818b8ae7c3216b9


commit 81c33684e54e89c0f48910578818b8ae7c3216b9
Author: Bastiaan Jacques <address@hidden>
Date:   Mon May 26 01:04:47 2014 +0200

    Atomize a bunch of members that are read and written by the
    parser thread and the main thread, in undetermined order.

diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index 23cdca8..edf3938 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -457,7 +457,7 @@ SWFMovieDefinition::read_all_swf()
     try {
         while (left) {
 
-            if (_loadingCanceled) {
+            if (_loadingCanceled.load()) {
                 log_debug("Loading thread cancellation requested, "
                         "returning from read_all_swf");
                 return;
@@ -533,7 +533,7 @@ SWFMovieDefinition::incrementLoadedFrames()
 
     // signal load of frame if anyone requested it
     // FIXME: _waiting_for_frame needs mutex ?
-    if (_waiting_for_frame && _frames_loaded.load() >= _waiting_for_frame )
+    if (_waiting_for_frame.load() && _frames_loaded.load() >= 
_waiting_for_frame.load() )
     {
         // or should we notify_one ?
         // See: http://boost.org/doc/html/condition.html
diff --git a/libcore/parser/SWFMovieDefinition.h 
b/libcore/parser/SWFMovieDefinition.h
index d4f5df7..3c60643 100644
--- a/libcore/parser/SWFMovieDefinition.h
+++ b/libcore/parser/SWFMovieDefinition.h
@@ -199,7 +199,7 @@ public:
     
     /// Check whether tags should be executed using AVM2
     bool isAS3() const {
-        return _as3;
+        return _as3.load();
     }
 
     /// Return the advertised version for the SWFMovie.
@@ -448,10 +448,7 @@ private:
     mutable std::condition_variable _frame_reached_condition;
 
     /// Set this to trigger signaling of loaded frame
-    //
-    /// Make sure you _frames_loaded_mutex is locked
-    /// when accessing this member !
-    mutable size_t _waiting_for_frame;
+    mutable std::atomic<size_t> _waiting_for_frame;
 
     /// Number bytes loaded / parsed
     std::atomic<unsigned long> _bytes_loaded;
@@ -470,6 +467,8 @@ private:
     std::unique_ptr<IOChannel> _in;
 
     /// swf end position (as read from header)
+    // This is set by readHeader, and used in the parsing thread, which starts
+    // after readHeader() runs.
     size_t _swf_end_pos;
 
     /// asyncronous SWF loader and parser
@@ -487,7 +486,7 @@ private:
     }
 
     /// A flag set to true when load cancellation is requested
-    bool _loadingCanceled;
+    std::atomic<bool> _loadingCanceled;
 
     /// Movies we import resources from
     std::set< boost::intrusive_ptr<movie_definition> > _importSources;
@@ -502,7 +501,7 @@ private:
     ///         movie_root with the same RunResources as its first definition.
     const RunResources& _runResources;
 
-    bool _as3;
+    std::atomic<bool> _as3;
 
 };
 

-----------------------------------------------------------------------

Summary of changes:
 libcore/parser/SWFMovieDefinition.cpp |    4 ++--
 libcore/parser/SWFMovieDefinition.h   |   13 ++++++-------
 2 files changed, 8 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]