提交 1df01355 编写于 作者: D Davidlohr Bueso 提交者: Linus Torvalds

signal: use current->state helpers

Call __set_current_state() instead of assigning the new state directly.
These interfaces also aid CONFIG_DEBUG_ATOMIC_SLEEP environments, keeping
track of who changed the state.
Signed-off-by: NDavidlohr Bueso <dbueso@suse.de>
Acked-by: NOleg Nesterov <oleg@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 1cca3385
...@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler) ...@@ -3550,7 +3550,7 @@ SYSCALL_DEFINE2(signal, int, sig, __sighandler_t, handler)
SYSCALL_DEFINE0(pause) SYSCALL_DEFINE0(pause)
{ {
while (!signal_pending(current)) { while (!signal_pending(current)) {
current->state = TASK_INTERRUPTIBLE; __set_current_state(TASK_INTERRUPTIBLE);
schedule(); schedule();
} }
return -ERESTARTNOHAND; return -ERESTARTNOHAND;
...@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set) ...@@ -3563,7 +3563,7 @@ int sigsuspend(sigset_t *set)
current->saved_sigmask = current->blocked; current->saved_sigmask = current->blocked;
set_current_blocked(set); set_current_blocked(set);
current->state = TASK_INTERRUPTIBLE; __set_current_state(TASK_INTERRUPTIBLE);
schedule(); schedule();
set_restore_sigmask(); set_restore_sigmask();
return -ERESTARTNOHAND; return -ERESTARTNOHAND;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册