wake_up_interruptible 函数
来源:互联网 发布:python split去掉空格 编辑:程序博客网 时间:2024/05/20 21:19
功能:唤醒注册到等待队列上的进程
原型:
原型:
说明:
变量:
q :
在驱动中实现读取操作时,使用了
- wait_event_interruptible(button_waitq, ev_press);
- ev_press = 1;
//表示中断发生了 - wake_up_interruptible(&button_waitq);
//唤醒休眠的进程
查找资料,阅读源代码。
- #define wait_event_interruptible(wq, condition)
\ - ({
\ -
int __ret = 0; \ -
if (!(condition)) \ -
__wait_event_interruptible(wq, condition, __ret);\ -
__ret; \ - })
- #define __wait_event_interruptible(wq, condition, ret)
\ - do {
\ -
DEFINE_WAIT(__wait); \ -
\ -
for (;;) { \ -
prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ -
if (condition) \ -
break; \ -
if (!signal_pending(current)) { \ -
schedule(); \ -
continue; \ -
} \ -
ret = -ERESTARTSYS; \ -
break; \ -
} \ -
finish_wait(&wq, &__wait); \ - } while (0)
- //唤醒 q 指定的注册在等待队列上的进程。该函数不能直接的立即唤醒进程,而是由调度程序转换上下文,调整为可运行状态。
- wake_up_interruptible (wait_queue_head_t *q);
不知道内核这样设计是基于什么原因?
上下文切换(Context Switching):在多任务系统中,上下文切换是指CPU的控制权由运行任务转移到另外一个就绪任务时所发生的事件,当前运行任务转为就绪(或者挂起、删除)状态,另一个被选定的就绪任务成为当前任务。上下文切换包括保存当前任务的运行环境,恢复将要运行任务的运行环境。上下文的内容依赖于具体的CPU。
http://www.groad.net/bbs/read.php?tid-1336.html
http://www.100ask.net/forum/showtopic-4322.aspx
阅读全文
0 0
- wake_up_interruptible 函数
- wake_up_interruptible 函数
- analysis of wake_up_interruptible()
- wait_event_interruptible和wake_up_interruptible
- Linux驱动中的 wait_event_interruptible 与 wake_up_interruptible 深度理解
- Linux使用wake_up_interruptible()唤醒注册到等待队列上的进程
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- 函数
- org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/String;I)Z -> [Help 1]
- 【旧资料整理】无法删除文件,文件正在被另一个人或程序使用和无法删除硬件 完美解决办法
- Spring 整合 MyBatis,Mapper注入失败
- Ice grid eclipse插件的安装
- Gym 101246F list and iterator
- wake_up_interruptible 函数
- c语言基础
- POJ 2308 Dearboy's Puzzle 笔记
- 栈的链式存储结构
- LeetCode@Tree_606_Construct_String_from_Binary_Tree
- 【旧资料整理】php 变量前面加@的含意
- OptionsMenu创建使用
- 二叉搜索树的后序遍历
- 假设复制源目录 为 web ,目标目录为oj。怎样才能将web下所有文件复制到oj下了 -rf 不删除 别名 alias