// wake_up 是个宏,展开后调用的是 __wake_up 函数 // __wake_up(x, TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 1, NULL) int__wake_up(structwait_queue_head *wq_head, unsignedintmode,intnr_exclusive,void*key) { return__wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); } ...
#define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) void __wake_up(structwait_queue_head*wq_head, unsigned int mode, int nr_exclusive, void *key) { __wake_up_common_lock(wq_head, mode, nr_exclusive, 0, key); } void __wake_up_common_lock(struct wait_queue_head *wq_he...
{return__wake_up_common_lock(wq_head, mode, nr_exclusive,0, key); }EXPORT_SYMBOL(__wake_up);// __wake_up_common_lock(wq_head, TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 1, 0, NULL)staticint__wake_up_common_lock(structwait_queue_head *wq_head,unsignedintmode,intnr_exclusive,intwake...
#define wake_up(x) __wake_up(x, TASK_NORMAL, 1, NULL) //该方法中主要是在自旋锁的状态下调用__wake_up_common方法 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive, void *key) { unsigned long flags; spin_lock_irqsave(&q->lock, flags); __wake_up_comm...
// wake_up 是个宏,展开后调用的是 __wake_up 函数 // __wake_up(x, TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE, 1, NULL) int__wake_up(structwait_queue_head*wq_head,unsignedintmode,intnr_exclusive,void*key) { return__wake_up_common_lock(wq_head,mode,nr_exclusive,0,key); ...
2. 在内核中另一处,调用wake_up()函数唤醒等待队列中的睡眠进程。 注:使用wait_event()函数使得进程睡眠;而在内核另一处有一个对应的wake_up()函数被调用。 (二)初始化等待队列元素 有两种方法初始化队列: 1. 动态初始化init_waitqueue_entry()
__wake_up()函数的实现: void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr_exclusive, void *key) { unsigned int flags; spin_lock_irqsave(&p->lock,flags); __wake_up_common(q,mode,nr_exclusive,0,key); spin_unlock_irqstore(&p->lock, flags); ...
spinlock_t lock; struct list_head task_list; }; typedef struct__wait_queue_head wait_queue_head_t; 等待队列是通过task_list双链表来实现,其数据成员是以下数据结构: typedef struct__wait_queue wait_queue_t; struct __wait_queue { unsigned int flags; ...
Assigning a PIN to a nano SIM card Setting a screen lock Setting up Smart Lock Turning the lock screen off Why can't I wake up or unlock my phone with my fingerprint?If your phone doesn't wake up or unlock when you touch the fingerprint scanner, check the followin...
Expand Up@@ -134,8 +134,8 @@ static void __wake_up_common_lock(struct wait_queue_head *wq_head, unsigned int * @nr_exclusive: how many wake-one or wake-many threads to wake up * @key: is directly passed to the wakeup function ...