summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2004-01-17 03:09:57 +0000
committerDavid Xu <davidxu@FreeBSD.org>2004-01-17 03:09:57 +0000
commite4dcaa6ee9fd1328b682b693d8aee2920f1ef96e (patch)
treea8e6248b52a3aaf5088a6fc7e11d963636eeaa3e
parentcc3782cbc7da606434e3a9b3aa6adf0093fd4f2f (diff)
Notes
-rw-r--r--lib/libkse/thread/thr_mutex.c21
-rw-r--r--lib/libpthread/thread/thr_mutex.c21
2 files changed, 6 insertions, 36 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c
index 464bc39fe793..1232f33a181d 100644
--- a/lib/libkse/thread/thr_mutex.c
+++ b/lib/libkse/thread/thr_mutex.c
@@ -1001,12 +1001,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */
@@ -1039,12 +1034,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */
@@ -1096,12 +1086,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */
diff --git a/lib/libpthread/thread/thr_mutex.c b/lib/libpthread/thread/thr_mutex.c
index 464bc39fe793..1232f33a181d 100644
--- a/lib/libpthread/thread/thr_mutex.c
+++ b/lib/libpthread/thread/thr_mutex.c
@@ -1001,12 +1001,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */
@@ -1039,12 +1034,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */
@@ -1096,12 +1086,7 @@ mutex_unlock_common(pthread_mutex_t *m, int add_reference)
* mutex:
*/
if ((*m)->m_owner != curthread)
- /*
- * Return an invalid argument error for no
- * owner and a permission error otherwise:
- */
- ret = (*m)->m_owner == NULL ? EINVAL : EPERM;
-
+ ret = EPERM;
else if (((*m)->m_type == PTHREAD_MUTEX_RECURSIVE) &&
((*m)->m_count > 0))
/* Decrement the count: */