diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-07-06 22:01:12 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-07-06 22:01:12 +0000 |
commit | a85d5c806068dc0d6332390c7a87e60ccd99be9a (patch) | |
tree | 86e578ddd361c9ed1cf71194346d069f74cefcb9 /linuxthreads/mutex.c | |
parent | 16f4ce383717857032c2033ef755da389716150a (diff) | |
download | glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.tar.gz |
Update.
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.
Diffstat (limited to 'linuxthreads/mutex.c')
-rw-r--r-- | linuxthreads/mutex.c | 21 |
1 files changed, 21 insertions, 0 deletions
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; |