lkml.org 
[lkml]   [2011]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/11] job control: reorganize wait_task_stopped()
On 05/12, Tejun Heo wrote:
>
> int main(int argc, char **argv)
> {
> pid_t child, control;
>
> child = fork();
> if (!child)
> while (1)
> pause();
>
> kill(child, SIGSTOP);
> waitid(P_PID, child, NULL, WSTOPPED | WNOWAIT);
>
> control = fork();
> if (!control) {
> while (1) {
> kill(child, SIGCONT);
> nanosleep(&ts1ms, NULL);
> kill(child, SIGSTOP);
> nanosleep(&ts1ms, NULL);

Damn, you are right, I think.

At first glance, do_wait() does

wait_task_stopped();
wait_task_continued();

and the state can be changed CONTINIUED -> STOPPED in between, right?
Or something else?

Thanks, for the explanation.

Oleg.



\
 
 \ /
  Last update: 2011-05-12 20:37    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog