mirror of https://gitee.com/openkylin/linux.git
semaphore: __down_common: use signal_pending_state()
Change __down_common() to use signal_pending_state() instead of open coding. The changes in kernel/semaphore.o are just artifacts, the state checks are optimized away. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Ingo Molnar <mingo@elte.hu> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3219445033
commit
5b2becc8cf
|
@ -212,9 +212,7 @@ static inline int __sched __down_common(struct semaphore *sem, long state,
|
|||
waiter.up = 0;
|
||||
|
||||
for (;;) {
|
||||
if (state == TASK_INTERRUPTIBLE && signal_pending(task))
|
||||
goto interrupted;
|
||||
if (state == TASK_KILLABLE && fatal_signal_pending(task))
|
||||
if (signal_pending_state(state, task))
|
||||
goto interrupted;
|
||||
if (timeout <= 0)
|
||||
goto timed_out;
|
||||
|
|
Loading…
Reference in New Issue