poll_wait无法阻塞是什么原因造成的?
static DECLARE_WAIT_QUEUE_HEAD(WaitQ);
static unsigned int device_poll(struct file *filp, poll_table *wait)
{
unsigned int mask=0;
poll_wait(filp,&WaitQ,wait);
mask|=POLLIN|POLLRDNORM;
return mask;
}
无法阻塞,如果将poll_wait换成interruptible_sleep_on就可以完成阻塞了
static unsigned int device_poll(struct file *filp, poll_table *wait)
{
unsigned int mask=0;
interruptible_sleep_on(&WaitQ);
mask|=POLLIN|POLLRDNORM;
return mask;
}
这是什么原因造成的?