Re: killing a kernel thread with SIGKILL

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

 



The reason why "set_current_state(TASK_RUNNING)" is not needed, is
because everytime you exit from the schedule() function, your state is
TASK_RUNNING - that is why the code is running.   I saw this in the
kernel source as a comment somewhere :-).
>             schedule();
>         }
>
>         /* we wake up here */
>         /* check for pending SIGKILL signal, die if there is any */
>         if (signal_pending(current)) {
>             kthread_debug("SIGKILL pending\n");
>             break;
>         }
>
>         /* is there a race condition ? */
>         condition = 0;
>         kthread_debug("mkthread woke up!\n");
>     }
>
>     /* change task stae to TASK_RUNNING before removing from wait queue */
>
>     set_current_state(TASK_RUNNING);

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux