aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/mutex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-04 00:22:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-04 00:22:32 +0000
commit4ad1d0cfbf96c3dbcf0ba104eb9f81bae6bdc6da (patch)
treee9cd4db68a06582802d945faf432460e54ceea82 /linuxthreads/mutex.c
parent68eefde7b626b57d5fde40980084feda77c89801 (diff)
downloadglibc-4ad1d0cfbf96c3dbcf0ba104eb9f81bae6bdc6da.tar
glibc-4ad1d0cfbf96c3dbcf0ba104eb9f81bae6bdc6da.tar.gz
glibc-4ad1d0cfbf96c3dbcf0ba104eb9f81bae6bdc6da.tar.bz2
glibc-4ad1d0cfbf96c3dbcf0ba104eb9f81bae6bdc6da.zip
(charmap_read): Prepend the condition filename == NULL.
Diffstat (limited to 'linuxthreads/mutex.c')
-rw-r--r--linuxthreads/mutex.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c
index 8b137043b2..9b9bcee9b9 100644
--- a/linuxthreads/mutex.c
+++ b/linuxthreads/mutex.c
@@ -38,7 +38,7 @@ strong_alias (__pthread_mutex_init, pthread_mutex_init)
int __pthread_mutex_destroy(pthread_mutex_t * mutex)
{
- if (mutex->__m_lock.__status != 0) return EBUSY;
+ if ((mutex->__m_lock.__status & 1) != 0) return EBUSY;
return 0;
}
strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)
@@ -49,7 +49,7 @@ int __pthread_mutex_trylock(pthread_mutex_t * mutex)
int retcode;
switch(mutex->__m_kind) {
- case PTHREAD_MUTEX_FAST_NP:
+ case PTHREAD_MUTEX_ADAPTIVE_NP:
retcode = __pthread_trylock(&mutex->__m_lock);
return retcode;
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -84,7 +84,7 @@ int __pthread_mutex_lock(pthread_mutex_t * mutex)
pthread_descr self;
switch(mutex->__m_kind) {
- case PTHREAD_MUTEX_FAST_NP:
+ case PTHREAD_MUTEX_ADAPTIVE_NP:
__pthread_lock(&mutex->__m_lock, NULL);
return 0;
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -122,7 +122,7 @@ int __pthread_mutex_timedlock (pthread_mutex_t *mutex,
return EINVAL;
switch(mutex->__m_kind) {
- case PTHREAD_MUTEX_FAST_NP:
+ case PTHREAD_MUTEX_ADAPTIVE_NP:
__pthread_lock(&mutex->__m_lock, NULL);
return 0;
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -158,7 +158,7 @@ strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
int __pthread_mutex_unlock(pthread_mutex_t * mutex)
{
switch (mutex->__m_kind) {
- case PTHREAD_MUTEX_FAST_NP:
+ case PTHREAD_MUTEX_ADAPTIVE_NP:
__pthread_unlock(&mutex->__m_lock);
return 0;
case PTHREAD_MUTEX_RECURSIVE_NP:
@@ -170,7 +170,7 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex)
__pthread_unlock(&mutex->__m_lock);
return 0;
case PTHREAD_MUTEX_ERRORCHECK_NP:
- if (mutex->__m_owner != thread_self() || mutex->__m_lock.__status == 0)
+ if (mutex->__m_owner != thread_self() || (mutex->__m_lock.__status & 1) == 0)
return EPERM;
mutex->__m_owner = NULL;
__pthread_alt_unlock(&mutex->__m_lock);
@@ -199,7 +199,7 @@ strong_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
{
- if (kind != PTHREAD_MUTEX_FAST_NP
+ if (kind != PTHREAD_MUTEX_ADAPTIVE_NP
&& kind != PTHREAD_MUTEX_RECURSIVE_NP
&& kind != PTHREAD_MUTEX_ERRORCHECK_NP
&& kind != PTHREAD_MUTEX_TIMED_NP)