about summary refs log tree commit diff
path: root/linuxthreads/mutex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-06 22:01:12 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-06 22:01:12 +0000
commita85d5c806068dc0d6332390c7a87e60ccd99be9a (patch)
tree86e578ddd361c9ed1cf71194346d069f74cefcb9 /linuxthreads/mutex.c
parent16f4ce383717857032c2033ef755da389716150a (diff)
downloadglibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.tar.gz
glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.tar.xz
glibc-a85d5c806068dc0d6332390c7a87e60ccd99be9a.zip
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.c21
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;