diff options
| author | Chris Zankel <[email protected]> | 2015-04-14 03:51:35 +0000 |
|---|---|---|
| committer | Chris Zankel <[email protected]> | 2015-04-14 03:51:35 +0000 |
| commit | 7ead5b7e4a3cf4a16579a8f164022345b93fe972 (patch) | |
| tree | 0a9b9497f53d1593c9e2ac197b2e686ea74a9975 /kernel/locking/rtmutex.c | |
| parent | 834a316eeebcb75316c0a7d9088fa638c52dc584 (diff) | |
| parent | 39a8804455fb23f09157341d3ba7db6d7ae6ee76 (diff) | |
Merge tag 'v4.0' into for_next
Linux 4.0
Diffstat (limited to 'kernel/locking/rtmutex.c')
| -rw-r--r-- | kernel/locking/rtmutex.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 7c98873a3077..6357265a31ad 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -1130,6 +1130,7 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state, set_current_state(state); } + __set_current_state(TASK_RUNNING); return ret; } @@ -1188,12 +1189,13 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, ret = task_blocks_on_rt_mutex(lock, &waiter, current, chwalk); if (likely(!ret)) + /* sleep on the mutex */ ret = __rt_mutex_slowlock(lock, state, timeout, &waiter); - set_current_state(TASK_RUNNING); - if (unlikely(ret)) { - remove_waiter(lock, &waiter); + __set_current_state(TASK_RUNNING); + if (rt_mutex_has_waiters(lock)) + remove_waiter(lock, &waiter); rt_mutex_handle_deadlock(ret, chwalk, &waiter); } @@ -1626,10 +1628,9 @@ int rt_mutex_finish_proxy_lock(struct rt_mutex *lock, set_current_state(TASK_INTERRUPTIBLE); + /* sleep on the mutex */ ret = __rt_mutex_slowlock(lock, TASK_INTERRUPTIBLE, to, waiter); - set_current_state(TASK_RUNNING); - if (unlikely(ret)) remove_waiter(lock, waiter); |