mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
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.
This commit is contained in:
parent
16f4ce3837
commit
a85d5c8060
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user