summaryrefslogtreecommitdiffstats
path: root/lib/libkse/thread/thr_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkse/thread/thr_mutex.c')
-rw-r--r--lib/libkse/thread/thr_mutex.c50
1 files changed, 9 insertions, 41 deletions
diff --git a/lib/libkse/thread/thr_mutex.c b/lib/libkse/thread/thr_mutex.c
index 0f67b4b..86e0b8b 100644
--- a/lib/libkse/thread/thr_mutex.c
+++ b/lib/libkse/thread/thr_mutex.c
@@ -887,21 +887,9 @@ mutex_unlock_common(pthread_mutex_t * mutex, int add_reference)
*/
if (((*mutex)->m_owner =
mutex_queue_deq(*mutex)) != NULL) {
- /*
- * Unless the new owner of the mutex is
- * currently suspended, allow the owner
- * to run. If the thread is suspended,
- * make a note that the thread isn't in
- * a wait queue any more.
- */
- if (((*mutex)->m_owner->state !=
- PS_SUSPENDED)) {
- PTHREAD_NEW_STATE((*mutex)->m_owner,
- PS_RUNNING);
- } else {
- (*mutex)->m_owner->suspended =
- SUSP_NOWAIT;
- }
+ /* Make the new owner runnable: */
+ PTHREAD_NEW_STATE((*mutex)->m_owner,
+ PS_RUNNING);
/*
* Add the mutex to the threads list of
@@ -1019,20 +1007,10 @@ mutex_unlock_common(pthread_mutex_t * mutex, int add_reference)
(*mutex)->m_prio;
/*
- * Unless the new owner of the mutex is
- * currently suspended, allow the owner
- * to run. If the thread is suspended,
- * make a note that the thread isn't in
- * a wait queue any more.
+ * Make the new owner runnable:
*/
- if (((*mutex)->m_owner->state !=
- PS_SUSPENDED)) {
- PTHREAD_NEW_STATE((*mutex)->m_owner,
- PS_RUNNING);
- } else {
- (*mutex)->m_owner->suspended =
- SUSP_NOWAIT;
- }
+ PTHREAD_NEW_STATE((*mutex)->m_owner,
+ PS_RUNNING);
}
}
break;
@@ -1148,20 +1126,10 @@ mutex_unlock_common(pthread_mutex_t * mutex, int add_reference)
(*mutex)->m_prio;
/*
- * Unless the new owner of the mutex is
- * currently suspended, allow the owner
- * to run. If the thread is suspended,
- * make a note that the thread isn't in
- * a wait queue any more.
+ * Make the new owner runnable:
*/
- if (((*mutex)->m_owner->state !=
- PS_SUSPENDED)) {
- PTHREAD_NEW_STATE((*mutex)->m_owner,
- PS_RUNNING);
- } else {
- (*mutex)->m_owner->suspended =
- SUSP_NOWAIT;
- }
+ PTHREAD_NEW_STATE((*mutex)->m_owner,
+ PS_RUNNING);
}
}
break;
OpenPOWER on IntegriCloud