进程调度API之init_waitqueue_head
来源:互联网 发布:上海市软件著作权资助 编辑:程序博客网 时间:2024/05/16 14:56
void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *)是等待队列的基础适用函数之一,之前的博文已经给出过等待队列的用法了这个函数的作用是初始化等待队列的头指针,使参数q的task_list字段的next和prev都指向头指针自身其源码分析如下:#define init_waitqueue_head(q)\do {\static struct lock_class_key __key;\\__init_waitqueue_head((q), #q, &__key);\} while (0)这里定义一个__key变量后,将__key的指针传递给__init_waitqueue_head,这里的#q是将q变成字符串继续看__init_waitqueue_headvoid __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct lock_class_key *key){// 初始化spin lockspin_lock_init(&q->lock);//用于debug 死锁的情况lockdep_set_class_and_name(&q->lock, key, name);// 初始化指针INIT_LIST_HEAD(&q->task_list);}双向链表的基本初始化static inline voidINIT_LIST_HEAD(struct list_head *list){ list->next = list->prev = list;}
阅读全文
0 0
- 进程调度API之init_waitqueue_head
- 进程调度API之__wake_up
- 进程调度API之__wake_up_sync
- 进程调度API之preempt_count_dec_and_test
- 进程调度API之should_resched
- 进程调度API之preempt_schedule
- 进程调度API之add_wait_queue_exclusive
- 进程调度API之autoremove_wake_function
- 进程调度API之complete
- 进程调度API之complete_all
- 进程调度API之completion_done
- 进程调度API之wait_for_completion_x
- 进程调度API之finish_wait
- 进程调度API之init_waitqueue_entry
- 进程调度API之prepare_to_wait
- 进程调度API之set_cpus_allowed_ptr
- 进程调度API之set_user_nice
- 进程调度API之sleep_on_spinunlock
- 从虚拟机中下载文件到本地
- 11_等待/通知(wait/notify)机制介绍
- 使用MockMVC测试控制器【转】
- SD卡文件权限
- 异步上传图片-不压缩图片
- 进程调度API之init_waitqueue_head
- HDU 3974 Assign the task (并查集&线段树)
- 如何登陆服务器
- TCP三次握手wireshark抓包分析
- 数据结构-抽象数据类型
- php技能树
- Linux系统下强制踢掉登录用户
- Wget用法、参数解释的比较好的一个文章
- kong插件之Rate Limiting