[Android] Add pthread_condattr_(g,s)etpshared() for 2.1

Rafaël Carré git at videolan.org
Sat Mar 10 01:59:11 CET 2012


android | branch: master | Rafaël Carré <funman at videolan.org> | Mon Mar  5 14:45:45 2012 -0500| [394c23c69ade864ebf6645faee90175295888c6f] | committer: Rafaël Carré

Add pthread_condattr_(g,s)etpshared() for 2.1

They are used by pthread-rwlocks.c

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

 vlc-android/jni/pthread-condattr.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/vlc-android/jni/pthread-condattr.c b/vlc-android/jni/pthread-condattr.c
index 450f71d..1a4d657 100644
--- a/vlc-android/jni/pthread-condattr.c
+++ b/vlc-android/jni/pthread-condattr.c
@@ -47,3 +47,24 @@ int pthread_condattr_destroy(pthread_condattr_t *attr)
     return 0;
 }
 
+int pthread_condattr_getpshared(pthread_condattr_t *attr, int *pshared)
+{
+    if (attr == NULL || pshared == NULL)
+        return EINVAL;
+
+    *pshared = *attr;
+    return 0;
+}
+
+int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
+{
+    if (attr == NULL)
+        return EINVAL;
+
+    if (pshared != PTHREAD_PROCESS_SHARED &&
+        pshared != PTHREAD_PROCESS_PRIVATE)
+        return EINVAL;
+
+    *attr = pshared;
+    return 0;
+}



More information about the Android mailing list