linux等待队列例子

  • 时间:
  • 来源:互联网
  • 文章标签:

定义

wait_queue_head_t listenning_queue;
int condition_state;

初始化

 init_waitqueue_head(&listenning_queue);

休眠

condition_state = 0;
 wait_event_interruptible(listenning_queue, condition_state);  

唤醒

condition_state = 1;
wake_up_interruptible(&listenning_queue);

本文链接http://www.taodudu.cc/news/show-1781853.html