* stop threads failed!
@ 2005-12-17 8:57 Hua Feijun
2005-12-18 8:36 ` Nauman Tahir
0 siblings, 1 reply; 3+ messages in thread
From: Hua Feijun @ 2005-12-17 8:57 UTC (permalink / raw)
To: linux-kernel
I want to set threads's status to TASK_STOPPED by the following
code.The syslog has show this rourine has been executed,buf the thread
is still running.Who can tell me the reason?Thanks very much!
write_lock(&tasklist_lock);
do
{
printk("set threads stopped\n");
p->state = TASK_STOPPED;
} while ((p = next_thread(p)) != leader);
write_unlock(&tasklist_lock);
schedule();
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: stop threads failed!
2005-12-17 8:57 stop threads failed! Hua Feijun
@ 2005-12-18 8:36 ` Nauman Tahir
[not found] ` <3fe1d240512181717h59100c1h@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Nauman Tahir @ 2005-12-18 8:36 UTC (permalink / raw)
To: Hua Feijun; +Cc: linux-kernel
On 12/17/05, Hua Feijun <hua.feijun@gmail.com> wrote:
> I want to set threads's status to TASK_STOPPED by the following
> code.The syslog has show this rourine has been executed,buf the thread
> is still running.Who can tell me the reason?Thanks very much!
> write_lock(&tasklist_lock);
> do
> {
> printk("set threads stopped\n");
> p->state = TASK_STOPPED;
> } while ((p = next_thread(p)) != leader);
> write_unlock(&tasklist_lock);
> schedule();
> -
Have you specified the state TASK_INTERRUPTIBLE when you wake up the
thread? If not then do it to ba able to stop it later.
Anybody else correct me if I am wrong please
Regards
Nauman
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-12-19 6:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-17 8:57 stop threads failed! Hua Feijun
2005-12-18 8:36 ` Nauman Tahir
[not found] ` <3fe1d240512181717h59100c1h@mail.gmail.com>
2005-12-19 6:42 ` Nauman Tahir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®