summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_mutex_prioceiling.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkse/thread/thr_mutex_prioceiling.c')
-rw-r--r--lib/libkse/thread/thr_mutex_prioceiling.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/libkse/thread/thr_mutex_prioceiling.c b/lib/libkse/thread/thr_mutex_prioceiling.c
index 7d2e92e..a78b5d1 100644
--- a/lib/libkse/thread/thr_mutex_prioceiling.c
+++ b/lib/libkse/thread/thr_mutex_prioceiling.c
@@ -98,16 +98,14 @@ _pthread_mutex_setprioceiling(pthread_mutex_t *mutex,
ret = EINVAL;
else if ((*mutex)->m_protocol != PTHREAD_PRIO_PROTECT)
ret = EINVAL;
- else {
- /* Lock the mutex: */
- if ((ret = pthread_mutex_lock(mutex)) == 0) {
- /* Return the old ceiling and set the new ceiling: */
- *old_ceiling = (*mutex)->m_prio;
- (*mutex)->m_prio = prioceiling;
+ /* Lock the mutex: */
+ else if ((ret = pthread_mutex_lock(mutex)) == 0) {
+ /* Return the old ceiling and set the new ceiling: */
+ *old_ceiling = (*mutex)->m_prio;
+ (*mutex)->m_prio = prioceiling;
- /* Unlock the mutex: */
- ret = pthread_mutex_unlock(mutex);
- }
+ /* Unlock the mutex: */
+ ret = pthread_mutex_unlock(mutex);
}
return(ret);
}
OpenPOWER on IntegriCloud