Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 6 Jul 2000 22:01:12 +0000 (22:01 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 6 Jul 2000 22:01:12 +0000 (22:01 +0000)
2000-07-06  Ulrich Drepper  <drepper@redhat.com>

* condvar.c: Implement pthread_condattr_getpshared and
pthread_condattr_setpshared.
* mutex.c: Implement pthread_mutexattr_getpshared and
 pthread_mutexattr_setpshared.
* Versions: Export new functions.
* sysdeps/pthread/pthread.h: Add prototypes for new functions.

* rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
(pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
is not selected.

linuxthreads/ChangeLog
linuxthreads/Versions
linuxthreads/mutex.c
linuxthreads/rwlock.c
linuxthreads/sysdeps/pthread/pthread.h

index fa823bc..d825934 100644 (file)
@@ -1,3 +1,16 @@
+2000-07-06  Ulrich Drepper  <drepper@redhat.com>
+
+       * condvar.c: Implement pthread_condattr_getpshared and
+       pthread_condattr_setpshared.
+       * mutex.c: Implement pthread_mutexattr_getpshared and
+        pthread_mutexattr_setpshared.
+       * Versions: Export new functions.
+       * sysdeps/pthread/pthread.h: Add prototypes for new functions.
+
+       * rwlock.c (pthread_rwlockattr_init): Use PTHREAD_PROCESS_PRIVATE.
+       (pthread_rwlockattr_setpshared): Fail if PTHREAD_PROCESS_PRIVATE
+       is not selected.
+
 2000-07-04  Greg McGary  <greg@mcgary.org>
 
        * sysdeps/pthread/bits/libc-lock.h: Remove BP_SYM from
index 85a58e1..94a18e5 100644 (file)
@@ -130,7 +130,11 @@ libpthread {
     __pthread_rwlock_tryrdlock; __pthread_rwlock_wrlock;
     __pthread_rwlock_trywrlock; __pthread_rwlock_unlock;
 
-    # New functions from IEEE Std. 10003.1-200x.
+    # No really implemented.
+    pthread_condattr_getpshared; pthread_condattr_setpshared;
+    pthread_mutexattr_getpshared; pthread_mutexattr_setpshared;
+
+    # New functions from IEEE Std. 1003.1-200x.
     sem_timedwait;
     pthread_spin_destroy; pthread_spin_init; pthread_spin_lock;
     pthread_spin_trylock; pthread_spin_unlock;
index 9b9bcee..d7674ff 100644 (file)
@@ -220,6 +220,27 @@ weak_alias (__pthread_mutexattr_gettype, pthread_mutexattr_gettype)
 strong_alias (__pthread_mutexattr_gettype, __pthread_mutexattr_getkind_np)
 weak_alias (__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np)
 
+int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr,
+                                  int *pshared)
+{
+  *pshared = PTHREAD_PROCESS_PRIVATE;
+  return 0;
+}
+weak_alias (__pthread_mutexattr_getpshared, pthread_mutexattr_getpshared)
+
+int __pthread_mutexattr_setpshared (pthread_mutexattr_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;
+}
+weak_alias (__pthread_mutexattr_setpshared, pthread_mutexattr_setpshared)
+
 /* Once-only execution */
 
 static pthread_mutex_t once_masterlock = PTHREAD_MUTEX_INITIALIZER;
index 2bcdf97..9258978 100644 (file)
@@ -596,7 +596,7 @@ int
 pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
 {
   attr->__lockkind = 0;
-  attr->__pshared = 0;
+  attr->__pshared = PTHREAD_PROCESS_PRIVATE;
 
   return 0;
 }
@@ -624,6 +624,10 @@ pthread_rwlockattr_setpshared (pthread_rwlockattr_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;
+
   attr->__pshared = pshared;
 
   return 0;
index f9e1fd9..dd27ae0 100644 (file)
@@ -325,6 +325,14 @@ extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) __THROW;
 /* Destroy mutex attribute object ATTR.  */
 extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) __THROW;
 
+/* Get the process-shared flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *__attr,
+                                        int *__pshared) __THROW;
+
+/* Set the process-shared flag of the mutex attribute ATTR.  */
+extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
+                                        int __pshared) __THROW;
+
 #ifdef __USE_UNIX98
 /* Set the mutex kind attribute in *ATTR to KIND (either PTHREAD_MUTEX_NORMAL,
    PTHREAD_MUTEX_RECURSIVE, PTHREAD_MUTEX_ERRORCHECK, or
@@ -375,6 +383,14 @@ extern int pthread_condattr_init (pthread_condattr_t *__attr) __THROW;
 /* Destroy condition variable attribute ATTR.  */
 extern int pthread_condattr_destroy (pthread_condattr_t *__attr) __THROW;
 
+/* Get the process-shared flag of the condition variable attribute ATTR.  */
+extern int pthread_condattr_getpshared (__const pthread_condattr_t *__attr,
+                                       int *__pshared) __THROW;
+
+/* Set the process-shared flag of the condition variable attribute ATTR.  */
+extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
+                                       int __pshared) __THROW;
+
 
 #ifdef __USE_UNIX98
 /* Functions for handling read-write locks.  */