内核线程中的set\u current\u state()宏是什么?
在研究内核线程时,我遇到了这段代码内核线程中的set\u current\u state()宏是什么?,c,linux,linux-kernel,linux-device-driver,C,Linux,Linux Kernel,Linux Device Driver,在研究内核线程时,我遇到了这段代码 while(!kthread_should_stop()){ set_current_state(TASK_RUNNING); /* Doing some stuff here */ set_current_state(TASK_INTERRUPTIBLE); msleep(1000); 宏设置当前状态用于什么,传递的参数是什么。根据本文 set\u current\u state()将当前正在执行的进程的状态从TASK\u RU
while(!kthread_should_stop()){
set_current_state(TASK_RUNNING);
/* Doing some stuff here */
set_current_state(TASK_INTERRUPTIBLE);
msleep(1000);
宏设置当前状态用于什么,传递的参数是什么。根据本文
set\u current\u state()
将当前正在执行的进程的状态从TASK\u RUNNING
更改为TASK\u interruptable
这里,TASK\u RUNNING
和TASK\u interruptable
是进程的两种状态
——准备运行的进程的状态为TASK\u RUNNINGTASK\u RUNNING
——调用进程的状态为TASK\u interruptable
,进程从运行队列中移出李>schedule()
set\u current\u state()
将当前正在执行的进程的状态从TASK\u RUNNING
更改为TASK\u interruptable
这里,TASK\u RUNNING
和TASK\u interruptable
是进程的两种状态
——准备运行的进程的状态为TASK\u RUNNINGTASK\u RUNNING
——调用进程的状态为TASK\u interruptable
,进程从运行队列中移出李>schedule()