mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-17 01:34:00 +08:00
locking/rtmutex: Clean up signal handling in __rt_mutex_slowlock()
The signal handling in __rt_mutex_slowlock() is open coded. Use signal_pending_state() instead. Aside of the cleanup this also prepares for the RT lock substituions which require support for TASK_KILLABLE. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20210326153944.533811987@linutronix.de
This commit is contained in:
parent
c2c360ed7f
commit
a51a327f3b
@ -1146,17 +1146,12 @@ static int __sched __rt_mutex_slowlock(struct rt_mutex *lock, int state,
|
|||||||
if (try_to_take_rt_mutex(lock, current, waiter))
|
if (try_to_take_rt_mutex(lock, current, waiter))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
if (timeout && !timeout->task) {
|
||||||
* TASK_INTERRUPTIBLE checks for signals and
|
|
||||||
* timeout. Ignored otherwise.
|
|
||||||
*/
|
|
||||||
if (likely(state == TASK_INTERRUPTIBLE)) {
|
|
||||||
/* Signal pending? */
|
|
||||||
if (signal_pending(current))
|
|
||||||
ret = -EINTR;
|
|
||||||
if (timeout && !timeout->task)
|
|
||||||
ret = -ETIMEDOUT;
|
ret = -ETIMEDOUT;
|
||||||
if (ret)
|
break;
|
||||||
|
}
|
||||||
|
if (signal_pending_state(state, current)) {
|
||||||
|
ret = -EINTR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user