wait_event_interruptible()
时间:2010-09-01 来源:yjvijfhvk
wait_event_interruptible()
wait_event_interruptible()。该函数修改task的状态为TASK_INTERRUPTIBLE,意味着改进程将不会继续运行直到被唤醒,然后被添加到等待队列wq中。 在wait_event_interruptible()中首先判断condition是不是已经满足,如果是则直接返回0,否则调用__wait_event_interruptible(),并用__ret来存放返回值 condition=0 就是睡眠了。 --------------------------------------------------------------- #define wait_event_interruptible(wq, condition) \ ({ \ int __ret = 0; \ if (!(condition)) \ __wait_event_interruptible(wq, condition, __ret);\ __ret; \ }) |
相关阅读 更多 +