diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-09-29 11:58:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-29 12:05:52 -0400 |
commit | aa55a08687059aa169d10a313c41f238c2070488 (patch) | |
tree | 9eaad6fc01e385778142b451a22bef99af9ecc68 /include/linux | |
parent | b20fd6508c565df04a6b5816f17e03b04d4f924d (diff) |
[PATCH] fix TASK_STOPPED vs TASK_NONINTERACTIVE interaction
do_signal_stop:
for_each_thread(t) {
if (t->state < TASK_STOPPED)
++sig->group_stop_count;
}
However, TASK_NONINTERACTIVE > TASK_STOPPED, so this loop will not
count TASK_INTERRUPTIBLE | TASK_NONINTERACTIVE threads.
See also wait_task_stopped(), which checks ->state > TASK_STOPPED.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
[ We really probably should always use the appropriate bitmasks to test
task states, not do it like this. Using something like
#define TASK_RUNNABLE (TASK_RUNNING | TASK_INTERRUPTIBLE | \
TASK_UNINTERRUPTIBLE | TASK_NONINTERACTIVE)
and then doing "if (task->state & TASK_RUNNABLE)" or similar. But the
ordering of the task states is historical, and keeping the ordering
does make sense regardless. ]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sched.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 49e617fa0f66..afe6c61f13e5 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -110,11 +110,11 @@ extern unsigned long nr_iowait(void); | |||
110 | #define TASK_RUNNING 0 | 110 | #define TASK_RUNNING 0 |
111 | #define TASK_INTERRUPTIBLE 1 | 111 | #define TASK_INTERRUPTIBLE 1 |
112 | #define TASK_UNINTERRUPTIBLE 2 | 112 | #define TASK_UNINTERRUPTIBLE 2 |
113 | #define TASK_STOPPED 4 | 113 | #define TASK_NONINTERACTIVE 4 |
114 | #define TASK_TRACED 8 | 114 | #define TASK_STOPPED 8 |
115 | #define EXIT_ZOMBIE 16 | 115 | #define TASK_TRACED 16 |
116 | #define EXIT_DEAD 32 | 116 | #define EXIT_ZOMBIE 32 |
117 | #define TASK_NONINTERACTIVE 64 | 117 | #define EXIT_DEAD 64 |
118 | 118 | ||
119 | #define __set_task_state(tsk, state_value) \ | 119 | #define __set_task_state(tsk, state_value) \ |
120 | do { (tsk)->state = (state_value); } while (0) | 120 | do { (tsk)->state = (state_value); } while (0) |