Re: stop threads failed!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/17/05, Hua Feijun <[email protected]> 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 [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux