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-2064-g1ac47cf
Date: Mon, 26 May 2014 23:53:56 +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  1ac47cf68092142849b452faaa859070687977a0 (commit)
       via  50801b3d070e35630cec848de3dea442496ddd6c (commit)
       via  0bdc8e9bc09fda0593af3ba1397a50ec649b99b1 (commit)
      from  0f2f92d6470f6c9f0953aa822ba03cfec5a6492f (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=1ac47cf68092142849b452faaa859070687977a0


commit 1ac47cf68092142849b452faaa859070687977a0
Author: Bastiaan Jacques <address@hidden>
Date:   Tue May 27 01:40:00 2014 +0200

    Always notify at the end of the thread.

diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index 0264c37..c0d8976 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -498,9 +498,9 @@ SWFMovieDefinition::read_all_swf()
         );
         _frames_loaded = m_frame_count;
         // Notify any thread waiting on frame reached condition
-        _frame_reached_condition.notify_all();
     }
     _loadingCanceled = true;
+    _frame_reached_condition.notify_all();
 }
 
 size_t

http://git.savannah.gnu.org/cgit//commit/?id=50801b3d070e35630cec848de3dea442496ddd6c


commit 50801b3d070e35630cec848de3dea442496ddd6c
Author: Bastiaan Jacques <address@hidden>
Date:   Tue May 27 01:38:27 2014 +0200

    Minor cleanup.

diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index 5180272..0264c37 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -106,13 +106,6 @@ SWFMovieLoader::isSelfThread() const
     return std::this_thread::get_id() == _thread.get_id();
 }
 
-// static..
-void
-SWFMovieLoader::execute(SWFMovieDefinition* md)
-{
-    md->read_all_swf();
-}
-
 bool
 SWFMovieLoader::start()
 {
@@ -125,7 +118,7 @@ SWFMovieLoader::start()
     // Those tests do seem a bit redundant, though...
     std::lock_guard<std::mutex> lock(_mutex);
 
-    _thread = std::thread(std::bind(execute, &_movie_def));
+    _thread = std::thread(&SWFMovieDefinition::read_all_swf, &_movie_def);
 
     return true;
 }
diff --git a/libcore/parser/SWFMovieDefinition.h 
b/libcore/parser/SWFMovieDefinition.h
index 3c60643..88a7de5 100644
--- a/libcore/parser/SWFMovieDefinition.h
+++ b/libcore/parser/SWFMovieDefinition.h
@@ -92,10 +92,6 @@ private:
 
     mutable std::mutex _mutex;
     std::thread _thread;
-
-    /// Entry point for the actual thread
-    static void execute(SWFMovieDefinition* md);
-
 };
 
 /// The Characters dictionary associated with each SWF file.

http://git.savannah.gnu.org/cgit//commit/?id=0bdc8e9bc09fda0593af3ba1397a50ec649b99b1


commit 0bdc8e9bc09fda0593af3ba1397a50ec649b99b1
Author: Bastiaan Jacques <address@hidden>
Date:   Tue May 27 01:35:15 2014 +0200

    Guard for the possibility that the parser thread has finished
    before we attempt to wait().

diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index f334a0f..5180272 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -370,14 +370,18 @@ SWFMovieDefinition::ensure_frame_loaded(size_t framenum) 
const
     return (framenum <= _frames_loaded.load());
 #endif
 
-    if ( framenum <= _frames_loaded.load() ) return true;
-
     _waiting_for_frame = framenum;
+
     std::mutex m;
     std::unique_lock<std::mutex> lock(m);
 
     // TODO: return false on timeout
-    _frame_reached_condition.wait(lock);
+
+    // Make sure we don't wait here if the frame has been loaded, or the
+    // loading thread has finished.
+    _frame_reached_condition.wait(lock, [&] () {
+            return framenum <= _frames_loaded.load() || _loadingCanceled;
+        });
 
     return ( framenum <= _frames_loaded.load() );
 }
@@ -503,6 +507,7 @@ SWFMovieDefinition::read_all_swf()
         // Notify any thread waiting on frame reached condition
         _frame_reached_condition.notify_all();
     }
+    _loadingCanceled = true;
 }
 
 size_t

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

Summary of changes:
 libcore/parser/SWFMovieDefinition.cpp |   22 ++++++++++------------
 libcore/parser/SWFMovieDefinition.h   |    4 ----
 2 files changed, 10 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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