您的位置:首页 > 大数据 > 人工智能

wait_event_interruptible()

2013-12-19 20:34 232 查看
原文地址:wait_event_interruptible()作者:joee33
wait_event_interruptible()。该函数修改task的状态为TASK_INTERRUPTIBLE,意味着改进程将不会继续运行直到被唤醒,然后被添加到等待队列wq中。

在wait_event_interruptible()中首先判断condition是不是已经满足,如果是则直接返回0,否则调用__wait_event_interruptible(),并用__ret来存放返回值

---------------------------------------------------------------

#define wait_event_interruptible(wq,
condition)

({

int __ret =
0;

if
(!(condition))

__wait_event_interruptible(wq,
condition, __ret);

__ret;

})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: