[Android] Update pthreads patch

Rafaël Carré git at videolan.org
Sat Apr 21 19:14:37 CEST 2012


android | branch: master | Rafaël Carré <funman at videolan.org> | Sat Apr 21 13:06:17 2012 -0400| [1da38fda325c3ce31fb07bf54e134ec53f0e1859] | committer: Rafaël Carré

Update pthreads patch

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=1da38fda325c3ce31fb07bf54e134ec53f0e1859
---

 compile.sh                                 |    2 +-
 patches/0001-android-threads-support.patch |   41 +++++++++++++---------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/compile.sh b/compile.sh
index 248bf1f..299f627 100755
--- a/compile.sh
+++ b/compile.sh
@@ -38,7 +38,7 @@ fi
 export PATH=${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:${PATH}
 
 # 1/ libvlc, libvlccore and its plugins
-TESTED_HASH=15b1a1b94
+TESTED_HASH=5069692bfb
 if [ ! -d "vlc" ]; then
     echo "VLC source not found, cloning"
     git clone git://git.videolan.org/vlc.git vlc
diff --git a/patches/0001-android-threads-support.patch b/patches/0001-android-threads-support.patch
index 8b9cef6..6734496 100644
--- a/patches/0001-android-threads-support.patch
+++ b/patches/0001-android-threads-support.patch
@@ -1,4 +1,4 @@
-From dc995ad26afac5a8f86dde801df87b62a73d2e58 Mon Sep 17 00:00:00 2001
+From 650f20450edb1a52a272afa046b2d2e5231b5594 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <funman at videolan.org>
 Date: Sat, 10 Mar 2012 04:54:23 -0500
 Subject: [PATCH 1/3] android: threads support
@@ -31,10 +31,10 @@ timer, rwlocks, mutexes, clock, threadvar
 are 100% shared with linux so it'd be useless to have 2 copies.
 ---
  include/vlc_threads.h |   13 +++
- lib/error.c           |   16 +++-
+ lib/error.c           |   10 ++
  src/Makefile.am       |   17 ++++
  src/posix/thread.c    |  245 +++++++++++++++++++++++++++++++++++++++++++------
- 4 files changed, 261 insertions(+), 30 deletions(-)
+ 4 files changed, 257 insertions(+), 28 deletions(-)
 
 diff --git a/include/vlc_threads.h b/include/vlc_threads.h
 index ebf94e2..dad50b1 100644
@@ -69,38 +69,35 @@ index ebf94e2..dad50b1 100644
  #define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER
  typedef pthread_cond_t  vlc_cond_t;
 diff --git a/lib/error.c b/lib/error.c
-index ef2ecdc..42f6b4e 100644
+index d053faa..52840e8 100644
 --- a/lib/error.c
 +++ b/lib/error.c
-@@ -35,17 +35,29 @@ static void libvlc_setup_threads (bool init)
-     static vlc_mutex_t lock = VLC_STATIC_MUTEX;
-     static uintptr_t refs = 0;
+@@ -33,11 +33,17 @@ static vlc_threadvar_t context;
+ static vlc_mutex_t lock = VLC_STATIC_MUTEX;
+ static uintptr_t refs = 0;
  
-+    void andro_init_threads(bool);
++void andro_init_threads(bool);
 +
+ void libvlc_threads_init (void)
+ {
      vlc_mutex_lock (&lock);
-     if (init)
+     if (refs++ == 0)
      {
--        if (refs++ == 0)
-+        if (refs++ == 0) {
 +#ifdef __ANDROID__
 +            /* XXX: move somewhere else? */
-+            andro_init_threads(init);
++            andro_init_threads(true);
 +#endif
-             vlc_threadvar_create (&context, free);
-+        }
+         vlc_threadvar_create (&context, free);
+         libvlc_log_init ();
      }
-     else
+@@ -52,6 +58,10 @@ void libvlc_threads_deinit (void)
      {
-         assert (refs > 0);
--        if (--refs == 0)
-+        if (--refs == 0) {
-             vlc_threadvar_delete (&context);
+         libvlc_log_deinit ();
+         vlc_threadvar_delete (&context);
 +#ifdef __ANDROID__
 +            /* XXX: move somewhere else? */
-+            andro_init_threads(init);
++            andro_init_threads(false);
 +#endif
-+        }
      }
      vlc_mutex_unlock (&lock);
  }
@@ -154,7 +151,7 @@ index 9ab1ca6..27bf38e 100644
  	posix/dirs.c \
  	misc/atomic.c \
 diff --git a/src/posix/thread.c b/src/posix/thread.c
-index a7a4873..6c36980 100644
+index a7a4873..598c692 100644
 --- a/src/posix/thread.c
 +++ b/src/posix/thread.c
 @@ -1,5 +1,5 @@



More information about the Android mailing list