反复检查condition是否成立,如果成立则退出,如果不成立则继续休眠;条件满足后,即把本进程运行状态置为运行态(此时如果不执行下面的函数 wake_up_interruptible,上面wait_event_interruptible还会继续休眠)
1. 关于 wait_event_interruptible() 和 wake_up()的使用 读一下wait_event_interruptible()的源码,不难发现这个函数先将 当前进程的状态设置成TASK_INTERRUPTIBLE,然后调用schedule(), 而schedule()会将位于TASK_INTERRUPTIBLE状态的当前进程从runqueue 队列中删除。从runqueue队列中删除的结果是,当前这个进程将不再...
一、适用情况 wait_event_interruptible_timeout和schedule_timeout的区别 当在某个硬件驱动程序中使用wait_event_interruptible_timeout时,执行的继续可以通过以下两种方式获得: 1.其他人在等待队列上调用了wake_up 2.超时到期。 而调用schedule_timeout的进程始终会在超时到期时被唤醒。 二、函数原型 wait_event_inte...
Linkerd 2.10(Step by Step)—将 GitOps 与 Linkerd 和 Argo CD 结合使用
1. 关于 wait_event_interruptible() 和 wake_up()的使用 读一下wait_event_interruptible()的源码,不难发现这个函数先将 当前进程的状态设置成TASK_INTERRUPTIBLE,然后调用schedule(),而schedule()会.
wait_event_interruptible(wq, condition) wake_up_interruptible(x) wq:等待队列,当后面的条件不成立则进程进入休眠 condition:判断条件 ,0或非0值 x: 等待队列,要唤醒的等待队列,即唤醒对应的进程 当函数中调用wait_event_interruptible后,如果条件不成立,就会一直卡在这里。不会往下执行。反复检查condition是否成立...