+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
__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;
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;
pthread_rwlockattr_init (pthread_rwlockattr_t *attr)
{
attr->__lockkind = 0;
- attr->__pshared = 0;
+ attr->__pshared = PTHREAD_PROCESS_PRIVATE;
return 0;
}
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;
/* 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
/* 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. */