[Android] Thread-safer

Geoffrey Métais git at videolan.org
Tue Feb 17 17:43:48 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 17 15:24:53 2015 +0100| [3aa0766fff1fbbc734a8aaa8901f41f4357d8dca] | committer: Geoffrey Métais

Thread-safer

CID #1270664

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=3aa0766fff1fbbc734a8aaa8901f41f4357d8dca
---

 vlc-android/src/org/videolan/vlc/Thumbnailer.java |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/Thumbnailer.java b/vlc-android/src/org/videolan/vlc/Thumbnailer.java
index a107400..3f74da7 100644
--- a/vlc-android/src/org/videolan/vlc/Thumbnailer.java
+++ b/vlc-android/src/org/videolan/vlc/Thumbnailer.java
@@ -109,7 +109,11 @@ public class Thumbnailer implements Runnable {
      * @return totalCount
      */
     public int getJobsCount(){
-        return totalCount;
+        int count;
+        lock.lock();
+        count = totalCount;
+        lock.unlock();
+        return count;
     }
 
     /**



More information about the Android mailing list