Commit 1da38fda authored by Rafaël Carré's avatar Rafaël Carré

Update pthreads patch

parent 4c974289
......@@ -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
......
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@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 @@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment