注册 登录
LUPA开源社区 返回首页

jiang001的个人空间 http://www.lupaworld.com/?263754 [收藏] [复制] [分享] [RSS]

我的博客

Linux驱动同步与互斥

已有 659 次阅读2011-6-3 14:48 |系统分类:IT技术|

  事件等待队列一般用于linux驱动的异步通信,也可以叫做申请设备使用权等待队列。当多个进程去操作一个设备时,这个时候一般要用到事件队列。

  1、不可中断睡眠:

  wait_event(queue, condition)

  wait_event_interruptible(queue, condition)

  两个函数只有在condition变为true才能唤醒,否则一直睡眠,即是调用wake_up()也不能唤醒。

  2、可中断睡眠

  wait_event_timeout(queue, condition, timeout)

  wait_event_interruptible_timeout(queue, condition, timeout)

  两个函数在condition变为true或wake_up_interruptible()被调用都能被唤醒。

  3,唤醒函数:

  void wake_up(wait_queue_head_t *queue); //唤醒所有

  void wake_up_interruptible(wait_queue_head_t *queue); //唤醒interruptible

 已同步至 jiang001的微博

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册
验证问答 换一个 验证码 换一个

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部