From a85d5c806068dc0d6332390c7a87e60ccd99be9a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 6 Jul 2000 22:01:12 +0000 Subject: Update. 2000-07-06 Ulrich Drepper * 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/mutex.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'linuxthreads/mutex.c') diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index 9b9bcee9b9..d7674ffadd 100644 --- a/linuxthreads/mutex.c +++ b/linuxthreads/mutex.c @@ -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; -- cgit v1.2.3