about summary refs log tree commit diff
path: root/linuxthreads/condvar.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-06 21:57:50 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-06 21:57:50 +0000
commit16f4ce383717857032c2033ef755da389716150a (patch)
tree7f5a1394bb6cfec1862f4155b29d749a6b381375 /linuxthreads/condvar.c
parent4fb7a71f12d6cb9e4cb696799f3d4505cfe80bf2 (diff)
downloadglibc-16f4ce383717857032c2033ef755da389716150a.tar.gz
glibc-16f4ce383717857032c2033ef755da389716150a.tar.xz
glibc-16f4ce383717857032c2033ef755da389716150a.zip
Implement pthread_condattr_getpshared and pthread_condattr_setpshared.
Diffstat (limited to 'linuxthreads/condvar.c')
-rw-r--r--linuxthreads/condvar.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/linuxthreads/condvar.c b/linuxthreads/condvar.c
index 5e1dd712d7..a6a31ca715 100644
--- a/linuxthreads/condvar.c
+++ b/linuxthreads/condvar.c
@@ -62,7 +62,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
   int already_canceled = 0;
 
   /* Check whether the mutex is locked and owned by this thread.  */
-  if (mutex->__m_kind != PTHREAD_MUTEX_TIMED_NP  
+  if (mutex->__m_kind != PTHREAD_MUTEX_TIMED_NP
       && mutex->__m_kind != PTHREAD_MUTEX_ADAPTIVE_NP
       && mutex->__m_owner != self)
     return EINVAL;
@@ -123,7 +123,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
   pthread_extricate_if extr;
 
   /* Check whether the mutex is locked and owned by this thread.  */
-  if (mutex->__m_kind != PTHREAD_MUTEX_TIMED_NP  
+  if (mutex->__m_kind != PTHREAD_MUTEX_TIMED_NP
       && mutex->__m_kind != PTHREAD_MUTEX_ADAPTIVE_NP
       && mutex->__m_owner != self)
     return EINVAL;
@@ -228,3 +228,21 @@ int pthread_condattr_destroy(pthread_condattr_t *attr)
 {
   return 0;
 }
+
+int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
+{
+  *pshared = PTHREAD_PROCESS_PRIVATE;
+  return 0;
+}
+
+int pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared)
+{
+  if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED)
+    return EINVAL;
+
+  /* For now it is not possible to shared a conditional variable.  */
+  if (pshared != PTHREAD_PROCESS_PRIVATE)
+    return ENOSYS;
+
+  return 0;
+}