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 | |
parent | 16f4ce383717857032c2033ef755da389716150a (diff) | |
download | glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.zip glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.tar.gz glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.tar.bz2 |
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')
-rw-r--r-- | linuxthreads/ChangeLog | 13 | ||||
-rw-r--r-- | linuxthreads/Versions | 6 | ||||
-rw-r--r-- | linuxthreads/mutex.c | 21 | ||||
-rw-r--r-- | linuxthreads/rwlock.c | 6 | ||||
-rw-r--r-- | linuxthreads/sysdeps/pthread/pthread.h | 16 |
5 files changed, 60 insertions, 2 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index fa823bc..d825934 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -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 diff --git a/linuxthreads/Versions b/linuxthreads/Versions index 85a58e1..94a18e5 100644 --- a/linuxthreads/Versions +++ b/linuxthreads/Versions @@ -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; diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index 9b9bcee..d7674ff 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; diff --git a/linuxthreads/rwlock.c b/linuxthreads/rwlock.c index 2bcdf97..9258978 100644 --- a/linuxthreads/rwlock.c +++ b/linuxthreads/rwlock.c @@ -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; diff --git a/linuxthreads/sysdeps/pthread/pthread.h b/linuxthreads/sysdeps/pthread/pthread.h index f9e1fd9..dd27ae0 100644 --- a/linuxthreads/sysdeps/pthread/pthread.h +++ b/linuxthreads/sysdeps/pthread/pthread.h @@ -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. */ |